MySQL Forums
Forum List  »  PHP

Re: Fatal error: Call to undefined function mysql_connect() in C:\Program Files\Apache Group\Apache2\practice\testsql.php on line 17
Posted by: Candy Ekangaki
Date: January 11, 2007 10:59AM

I am having a similar problem, I posted for help, see attached message. Does anyone have a solution?
Candy


I am new to php and mysql. I have tried to connect to mysql database using php and I have been unsucessful. I know that php and apache are working because I am able to write simple programs e.g phpinfo(), etc and have it run with correct outputs.
I have tried to connect using both mysql and mysqli and I keep having the same error. In the php.ini the following extensions are uncommented
extension=php_mysql.dll
extension=php_mysqli.dll
mysql and mysqli are located in the directory c:\php5\ext
The path to the directory in php.ini is
extension_dir = "C:\php5\ext"
I am running mysql server 5.0.27 and php 5.2.0. I downloaded and replaced the two libraries above with those on [dev.mysql.com]. I also included libmysql.dll to main directory C:\php5 which I also downloaded from the same site.
The error I get when I use mysql_connect or mysqli.connect is
"Fatal error: Call to undefined function mysql_connect() in C:\Apache2\htdocs\mysqlconnect.php on line 26"

To debug I turned on the in php.ini files so that when I restart apache the error
"PHP Startup: Unable to load dynamic library 'C:\php5\ext\phpmysql.dll' - the specified module could not be found" is displayed.

I even added the system variable PHPRC pointing to c:\php5. I still have the same error.

Does anyone know how to fix this. What am I doing wrong, I have tried uninstalling and reinstall php, apache and mysql several times. I am running out of ideas, please help.

Thanks,

Candy

Options: ReplyQuote


Subject
Written By
Posted
Re: Fatal error: Call to undefined function mysql_connect() in C:\Program Files\Apache Group\Apache2\practice\testsql.php on line 17
January 11, 2007 10:59AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.