tedsiuta Posted July 8, 2008 Share Posted July 8, 2008 Description of Problem: When I try to connect to mysql I obtain the fatal error: Call to undefined function mysql_connect() message. My XP home operating system is loaded with Apache 2, PHP 5.1.4, and mysql. PHP programs execute without any problems. Command line querys to mysql work great. The problem appears to be php is not talking to mysql. I verified the php.ini file extension.dir = "C:\php\ext" and that the extension=php_mysql.dll is set to work. I also checked that the php.ini file is in the windows folder. I rebooted the system - still a no go getting php to connect to mysql. Any suggestions? Thanks from Ted. Quote Link to comment Share on other sites More sharing options...
anon_login_001 Posted July 8, 2008 Share Posted July 8, 2008 Have you seen this? http://www.phpfreaks.com/forums/index.php/topic,126354.0.html Quote Link to comment Share on other sites More sharing options...
tedsiuta Posted July 8, 2008 Author Share Posted July 8, 2008 Yes, I'm aware of the license change and I've changed the php.ini file extension_dir to "C:\php\ext" and theextension=php_mysql.dll. I verified that the php.ini file is in the WINDOWS folder and that a copy of the php_mysql.dll librat is in the WINDOWS folder. The problem with php connecting to mysql on a windows xp platform still exists! Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted July 8, 2008 Share Posted July 8, 2008 I been meaning to update that FAQ, anon linked you to. Moving files out side of the PHP folder is no longer recommended. Keep all files where they are when PHP is installed. Firstly did you install PHP using the installer? If you have, go to php.net and download the zipped binaries package rather than the PHP installer. Extract the zip to where you have PHP installed, now move your php.ini in C:\Windows back to C:\php. Delete all other files you have moved <- these will interfere. Next step add PHP to the PATH Environment Variable. Once you have done the above make sure PHP is reading the php.ini you're editing, by running phpinfo function. Ignore the Configuration File (php.ini) Path line. Concentrate on the Loaded Configuration File line. It should read C:/php/php.ini If it is, has the MySQL extension loaded? You can tell this by scrolling down and finding a MySQL subheading. Quote Link to comment Share on other sites More sharing options...
gigas10 Posted July 9, 2008 Share Posted July 9, 2008 i bet you didnt install the mysql extensions when u installed php :-x Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.