Page 1 of 1

PHP5 and MySQL 5 Not Working Together

Posted: Tue Jun 06, 2006 6:31 pm
by newphpguy
I am running Windows XP with IIS and downloaded and installed both PHP 5 and MySQL 5. I get the following error:
Fatal error: Call to undefined function mysql_connect() in c:\Inetpub\wwwroot\hostingcomp.php on line 10
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\PHP\morephp\php_mysql.dll' - The specified procedure could not be found. in Unknown on line 0

php_mysql.dll is in that directory

Any help would be greatly appreciated as I am fairly new to PHP and MySQL.

Posted: Tue Jun 06, 2006 7:26 pm
by neophyte
Okay make sure IUSR_MACHINENAME can read and execute the dll. Make sure that in your php.ini your mysql extension is uncommented.

Posted: Tue Jun 06, 2006 9:05 pm
by feyd
Just so you know, mysqli is to be used with MySQL 5..

Posted: Wed Jun 07, 2006 7:40 am
by newphpguy
neophyte wrote:Okay make sure IUSR_MACHINENAME can read and execute the dll. Make sure that in your php.ini your mysql extension is uncommented.
All that is in place, but still get the same error messages

Posted: Wed Jun 07, 2006 7:41 am
by newphpguy
feyd wrote:Just so you know, mysqli is to be used with MySQL 5..
I am new to this, so I don't know what that means.

Posted: Wed Jun 07, 2006 7:49 am
by GM
Check your php.ini file, and ensure that the extension php_mysqli.dll is uncommented. You may also want to uncomment the php_mysql.dll file, although, as feyd says, mysql 5+ makes use of the mysqli library.


Edit:

if you display the phpinfo() page, you can see which modules are loaded - check to see whether the mysql libraries are loaded.

Posted: Wed Jun 07, 2006 8:21 am
by erupt
I had the same problem which i never got resolved .. there was no mysqli extension in my php.ini file so i added it in uncommented as well as having the regular mysql extenstion uncommented but still did not fix the problem.

Posted: Wed Jun 07, 2006 8:34 am
by erupt
I forgot to add this in my previous post and this may be silly but i've learned never to ignore the obvious and most silly when it comes to anything computer related, even when it seems way out of range ..... Is it possible that a firewall could be blocking the connection to MySQL?

Posted: Wed Jun 07, 2006 9:50 am
by newphpguy
Thanks for all your help, got it working...needed to uncomment both lines and get the right versions of the .dlls