jeboy Posted December 27, 2006 Share Posted December 27, 2006 Im having trouble with connecting to mysql server from my php script. When I tried to setup phpMyAdmin it returns an error like this: "Cannot load mysql extension. Please check your PHP configuration. - Documentation"When I tried to connect to mysql database using my own script ($connection = mysql_connect('localhost', 'user', 'pass') it returns an error message like this:"Fatal error: Call to undefined function mysql_connect() in C:\Program Files\Apache Group\Apache2\htdocs\db.php on line 9"I copy the libmysql.dll to WINDOWS/system32 directory and php.ini to WINDOWS directory, I also set the extension_dir of php.ini to "c:\php\ext" where is the actual location of extensions in my php installation directory and i Uncomment the extension=php_mysql.dllI used the following versions:PHP 5.1.4-Win32MySQL-essential-5.0.24-Win32Apache 2.0.59-Win32I also tried MySQL-essential-4.1.21-Win32 but still it returns an error.What should I do? Quote Link to comment https://forums.phpfreaks.com/topic/31923-cant-access-mysql-from-php-script/ Share on other sites More sharing options...
wildteen88 Posted December 28, 2006 Share Posted December 28, 2006 When you made the changes to the php.ini and moved the files did you restart Apache? You restart Apache in order for the changes to come into effect.Also it has nothing to do with the MySQL server. It is a PHP configuration issue. Please [url=http://www.phpfreaks.com/forums/index.php/topic,95378.0.html]read this FAQ[/url]. It should help you. Quote Link to comment https://forums.phpfreaks.com/topic/31923-cant-access-mysql-from-php-script/#findComment-148782 Share on other sites More sharing options...
jeboy Posted December 29, 2006 Author Share Posted December 29, 2006 Yes, I restart Apache when I made changes in php.ini but still I receive that particular error. Quote Link to comment https://forums.phpfreaks.com/topic/31923-cant-access-mysql-from-php-script/#findComment-149240 Share on other sites More sharing options...
wildteen88 Posted December 29, 2006 Share Posted December 29, 2006 Did you read the FAQ I link you to?Also is PHP using the correct php.ini? You can check this by creating a test script (test.php) and then adding the following code to it:[code]<?php phpinfo(); ?>[/code]Look for the following line - [b]Configuration File (php.ini) Path[/b]. To the right of that it should have the full path to the php.ini it is using. Is the the path C:\WINDOWS\php.ini? Quote Link to comment https://forums.phpfreaks.com/topic/31923-cant-access-mysql-from-php-script/#findComment-149296 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.