We have are building a WordPress site on our intranet site and wish to connect it to a Microsoft SQL Server.
I have downloaded and configured PHP and PHP Manager on IIS.
I have also downloaded SQL Server DLL from the list of answered questions that popped on as I was typing the title of this thread.
I downloaded those DLLs inside the PHP folder as instructed.
When I fired up the server address to install WordPress, I was prompted to provide SQL DB name, username, password and DB hostname.
I have also downloaded wp-db-Abstraction plugin, put the wp-db-abstraction.php file into the folder where the WordPress files are saved, put the wp-db-abstraction folder into wp_content as instructed by the online article I was reading. Inside this folder, there is a db.php file. I also copied this db.php file into foldername where the rest of the downloaded WordPress files reside.
When I clicked to continue, I got the following error messages:
Warning: mysqli_real_connect(): (HY000/2002): No connection could be made because the target machine actively refused it. in E:\foldername\wp-includes\wp-db.php on line 1538
Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in E:\foldername\wp-includes\wp-db.php on line 1569
Warning: mysql_connect(): No connection could be made because the target machine actively refused it. in E:\foldername\wp-includes\wp-db.php on line 1569
Error establishing a database connection
What is weird about the error is that it is coming from WP_Includes folder where there is another wp-db.php. This folder came with the WordPress downloaded files.
The weird thing is that the error above is coming from wp-db.php file, not from the db.php file I downloaded.
Am I supposed to remove db.php include file from the list?
Can anyone please tell me what I am missing?
We have are building a WordPress site on our intranet site and wish to connect it to a Microsoft SQL Server.
I have downloaded and configured PHP and PHP Manager on IIS.
I have also downloaded SQL Server DLL from the list of answered questions that popped on as I was typing the title of this thread.
I downloaded those DLLs inside the PHP folder as instructed.
When I fired up the server address to install WordPress, I was prompted to provide SQL DB name, username, password and DB hostname.
I have also downloaded wp-db-Abstraction plugin, put the wp-db-abstraction.php file into the folder where the WordPress files are saved, put the wp-db-abstraction folder into wp_content as instructed by the online article I was reading. Inside this folder, there is a db.php file. I also copied this db.php file into foldername where the rest of the downloaded WordPress files reside.
When I clicked to continue, I got the following error messages:
Warning: mysqli_real_connect(): (HY000/2002): No connection could be made because the target machine actively refused it. in E:\foldername\wp-includes\wp-db.php on line 1538
Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in E:\foldername\wp-includes\wp-db.php on line 1569
Warning: mysql_connect(): No connection could be made because the target machine actively refused it. in E:\foldername\wp-includes\wp-db.php on line 1569
Error establishing a database connection
What is weird about the error is that it is coming from WP_Includes folder where there is another wp-db.php. This folder came with the WordPress downloaded files.
The weird thing is that the error above is coming from wp-db.php file, not from the db.php file I downloaded.
Am I supposed to remove db.php include file from the list?
Can anyone please tell me what I am missing?
Share Improve this question edited Aug 23, 2018 at 12:01 Aurovrata 1,34611 silver badges18 bronze badges asked Aug 21, 2018 at 14:09 KennyKenny 1311 gold badge1 silver badge2 bronze badges 6- This is a php question, not a WordPress specific question for which you should seek an answer on the stackoverflow site which has several similar questions already answered. – Aurovrata Commented Aug 21, 2018 at 15:41
- 1 @Aurovrata, come on dude. That's where I posted the question and I got voted down because they said it is stackexchange question. What the heck is wrong here? – Kenny Commented Aug 21, 2018 at 15:56
- Well, if you are installing separate php libraries in your WordPress installation folder then its a php question, I don't understand why you expect WordPress devs to answer that one for you. On the other hand if you want to use the WordPress framework to make a custom db connection then you ought to change your question to reflect that. I am trying to help you increase your chances of finding as answer here, no hard feelings! – Aurovrata Commented Aug 21, 2018 at 16:06
- For example, here is a WP specific question of someone trying to achieve soemthing similar, and they got see this answer. – Aurovrata Commented Aug 21, 2018 at 16:08
- 1 @Aurovrata, just for clarity, I do not have issues connecting PHP to sql server. Infact, I have done that many times throughout my career. My issue is configuring wordpress to connect to SQL Server. Specifically, there is a file called wp-db.php inside wp-includes to gets called when I tried to test wordpress db setup. That's the file that is spitting out the error messages posted above. The link you referenced talks specifically to connecting to another MySQL. – Kenny Commented Aug 21, 2018 at 19:49
1 Answer
Reset to default 1I think there is a new approach to it:
- https://blogs.msdn.microsoft/brian_swan/2010/05/12/running-wordpress-on-sql-server/
You can also use a 3rd party version of WordPress (not my cup of tea, by the way):
https://code.google/archive/p/wordpress-mssql/
https://github/ProjectNami/projectnami
Or follow this guide, but it might be a bit old:
- https://blog.building-blocks/installing-wordpress-on-windows-using-sql-server-2008-r2-part-1/
In the end I think the first link would be the best approach. Please comment if you have any problem during the installation.