Jump to content

[SOLVED] PhpInfo() does not see MySql


JMair

Recommended Posts

I've just installed PHP5 and MySql 5.1.11 on a fresh Win2003 server with IIS. PHP is installed fine, but in the phpinfo() , I have no mention of MySQL.

In the Php.ini , the extensions are unchecked along with gd2 (that is shown in phpinfo()). The php_mysql.dll is in the php5/ext folder and I confirmed that mysql is up and running via the MySQLAdministrator gui tool.

 

I'm not sure where else to look, so any suggestions will be welcome.

 

Thank you kindly.

Link to comment
Share on other sites

The following is the mysql installation section from the php manual for Windows. Have you done everything it mentions -

Installation on Windows Systems

PHP 4

The PHP MySQL extension is compiled into PHP.

 

PHP 5+

MySQL is no longer enabled by default, so the php_mysql.dll DLL must be enabled inside of php.ini. Also, PHP needs access to the MySQL client library. A file named libmysql.dll is included in the Windows PHP distribution and in order for PHP to talk to MySQL this file needs to be available to the Windows systems PATH. See the FAQ titled "How do I add my PHP directory to the PATH on Windows" for information on how to do this. Although copying libmysql.dll to the Windows system directory also works (because the system directory is by default in the system's PATH), it's not recommended.

 

As with enabling any PHP extension (such as php_mysql.dll), the PHP directive extension_dir should be set to the directory where the PHP extensions are located. See also the Manual Windows Installation Instructions. An example extension_dir value for PHP 5 is c:\php\ext

 

Note: If when starting the web server an error similar to the following occurs: "Unable to load dynamic library './php_mysql.dll'", this is because php_mysql.dll and/or libmysql.dll cannot be found by the system.

 

Have you confirmed in the phpinfo() output that the php.ini that you are changing is the one that php is using?

 

And after making any changes to php.ini, have you stopped and started the IIS service to get any changes made to php.ini to take effect?

Link to comment
Share on other sites

The following is the mysql installation section from the php manual for Windows. Have you done everything it mentions -

Installation on Windows Systems

PHP 4

The PHP MySQL extension is compiled into PHP.

 

PHP 5+

MySQL is no longer enabled by default, so the php_mysql.dll DLL must be enabled inside of php.ini. Also, PHP needs access to the MySQL client library. A file named libmysql.dll is included in the Windows PHP distribution and in order for PHP to talk to MySQL this file needs to be available to the Windows systems PATH. See the FAQ titled "How do I add my PHP directory to the PATH on Windows" for information on how to do this. Although copying libmysql.dll to the Windows system directory also works (because the system directory is by default in the system's PATH), it's not recommended.

 

As with enabling any PHP extension (such as php_mysql.dll), the PHP directive extension_dir should be set to the directory where the PHP extensions are located. See also the Manual Windows Installation Instructions. An example extension_dir value for PHP 5 is c:\php\ext

 

Note: If when starting the web server an error similar to the following occurs: "Unable to load dynamic library './php_mysql.dll'", this is because php_mysql.dll and/or libmysql.dll cannot be found by the system.

 

Have you confirmed in the phpinfo() output that the php.ini that you are changing is the one that php is using?

 

And after making any changes to php.ini, have you stopped and started the IIS service to get any changes made to php.ini to take effect?

 

It is a fresh install of PHP with no previous version of PHP done with binaries not a setup. Only one php.ini i've been playing with. I've also Restered the WWW services and restarted the machine just in case.

 

But how do you enable the php_mysql.dll? Is is still just uncommenting out the extension?

Link to comment
Share on other sites

MySQL is up and running just fine. I'm just having troubles setting up the new PHP5 to recognize MySQL.

 

I've uncommented the extension. Made sure the mysql lib is in the php folder. I've also created (or I believe I have created) the System variables for MYSQL correctly. I've also (although I dont know if it's needed) have added the MySQLLib to the web service extensions.

 

Not sure what else I"m missing. Anything?

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.