MyBB Community Forums

Full Version: php mysql no database extensions
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm installing MyBB for the first time and getting the "No database extensions" error. I have mysql and mysqli enabled (and I've alternated with one or the other) in my php.ini. I followed Peter Guy's PHP setup instructions at http://www.peterguy.com/php/install_IIS6.html.

When I run php from the command line with the --ri mysqli it tells me the extension is loaded and good to go (AFAICT). Likewise for mysql.

But when I created an info file like below and open it in my browser...

 <?php
phpinfo();
?> 

I don't have any sections listed for mysql or mysqli like I would expect.

I heard somewhere that libmysql.dll needs to be in the system path in order for things to work. I've restarted IIS a number of times, but do I need to restart the W2k3 server for that path change to propagate where it is needed?

Any other ideas? I "own" the server since it is internal on a LAN. So any "hosting" issues are probably my fault - it is my first IIS6/PHP/MyBB setup (though IIS6 was running before I installed PHP - and it still runs).

I don't have the mySQL server installed on the same box as the webserver - I can remote login to it, right?

TIA!
Open your php.ini and make sure that extension_dir is set right. It is the path to the folder where all extensions are stored. Also make sure that you can find at least one or both of the following lines in your php.ini:
extension=php_mysql.dll
extension=php_mysqli.dll
Michael83 Wrote:Open your php.ini and make sure that extension_dir is set right. It is the path to the folder where all extensions are stored. Also make sure that you can find at least one or both of the following lines in your php.ini:
extension=php_mysql.dll
extension=php_mysqli.dll

Thanks for replying Michael, I double-checked both of those and they are correct.

I think I have been down the road of verifying that the extensions are loading as far as PHP is concerned. When I execute "php" from the command line it has no complaints, and the following command reports all is well:

 c:\> php --ri mysqli

mysqli

MysqlI Support => enabled
Client API library version => 5.0.45
Client API header version => 5.0.45
MYSQLI_SOCKET => /tmp/mysql.sock

Directive => Local Value => Master Value
mysqli.max_links => Unlimited => Unlimited
mysqli.default_host => no value => no value
mysqli.default_user => no value => no value
mysqli.default_pw => no value => no value
mysqli.default_port => 3306 => 3306
mysqli.default_socket => no value => no value
mysqli.reconnect => Off => Off

If the extension_dir was incorrect or the extension= lines were missing for mysqli I would expect it to fail like this:

c:\>php --ri mysqli
Extension 'mysqli' not present.

Perhaps when IIS is loading PHP it is not doing the same thing that I am seeing from the command line? Is there a way to get information out of IIS/PHP when they load in a "normal" fashion? Could it be bypassing my php.ini or failing in some (mostly) invisible way? I thought I had some reasonable assurance that PHP was working when I was able to open the forum/install/index.php.

Any other ideas?

TIA!
You can check the loaded php.ini by executing "php -i" from the command line. Somewhere in the output you should find the entry "Loaded Configuration File".

I do not use IIS but on Unix systems you usually have seperate php.ini files for the server and for the command line version. If this is the same on your system you should compare the two files. Remember that you have to restart the web server so that changes in your php.ini will take effect.
You want to restart the whole Server, it took a long time with me, about 12 hours, before I actually restarted it.
Thanks all, the reboot of the server resolved my issue - mysqli is reporting as loaded in my test.php page now.

And ct2k7, it took me a long time, too - it has been a few days of searching and trying all sorts of things before I did the simple reboot :-)