PHP5 and MySQL 5 Not Working Together

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
newphpguy
Forum Newbie
Posts: 6
Joined: Tue Jun 06, 2006 6:27 pm

PHP5 and MySQL 5 Not Working Together

Post 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.
User avatar
neophyte
DevNet Resident
Posts: 1537
Joined: Tue Jan 20, 2004 4:58 pm
Location: Minnesota

Post 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.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Just so you know, mysqli is to be used with MySQL 5..
newphpguy
Forum Newbie
Posts: 6
Joined: Tue Jun 06, 2006 6:27 pm

Post 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
newphpguy
Forum Newbie
Posts: 6
Joined: Tue Jun 06, 2006 6:27 pm

Post 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.
GM
Forum Contributor
Posts: 365
Joined: Wed Apr 26, 2006 4:19 am
Location: Italy

Post 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.
erupt
Forum Commoner
Posts: 58
Joined: Sat Feb 25, 2006 10:24 am

Post 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.
erupt
Forum Commoner
Posts: 58
Joined: Sat Feb 25, 2006 10:24 am

Post 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?
newphpguy
Forum Newbie
Posts: 6
Joined: Tue Jun 06, 2006 6:27 pm

Post by newphpguy »

Thanks for all your help, got it working...needed to uncomment both lines and get the right versions of the .dlls
Post Reply