
June 2nd, 2006, 09:25 PM
|
|
|
|
Join Date: Apr 2007
Posts: 1
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
"call to undefined function mysql_connect()"
I’m a Windows XP user that’s having a problem getting PHP to interact with MySQL. I have Apache 2.2.2 and PHP 5.1.4, which are working together just fine, and MySQL 5 is running, but I cannot connect to my MySQL 5 server using the mysql_connect function. I get the “call to undefined function mysql_connect()” error. I do not see any info about MySQL on the page brought up by the phpinfo() function, which makes me think I haven’t managed to configure PHP to work with MySQL.
Things I’ve done so far:
-set the username and password for MySQL
-added the php directory to my windows PATH
-enabled the php_mysql.dll extension (and added a line to enable php_mysqli.dll) in php.ini (I’ve tried this with and without mysqli enabled, and tried the alternative connect function “mysqli_connect”, it doesn’t work either way)
-added the “ext” directory in PHP to the extension_dir line of the php.ini (which was renamed from php.ini-recommended).
-tried downloading and using the “libmysql.dll” and “php_mysql.dll” files from the MySQL website instead of using the ones that come with the PHP installation.
-downgraded to lower versions of Apache / PHP / MySQL (this gave me more problems as the php4apache2.dll didn’t seem to work with Apache2.2, and the 2.0 version of Apache confused me as to the location of the config file, etc).
I’ve restarted the computer and restarted the Apache server after any major config changes, etc… nothing has worked so far. The MySQL website was mentioning recompiling PHP to support MySQL, but I used the zip file and don’t know how to compile from source – I didn’t even know what a webserver was before a month ago. I’ll probably try using XAMPP again soon or some other package deal, but when I last used XAMPP it was giving me problems with creating a MySQL account for some reason.
Anyone have any suggestions? Sorry for the length but I wanted to try to be specific. Thanks in advance.
|