PDA

View Full Version : "Call to undefined function mysql_connect()" - Help!


dannyg
28th October 2006, 12:11
Hi,

I'm currently in the process of trying to install a script onto my server (which I have installed and setup) but whenever I try and setup this script, I get:

Fatal error: Call to undefined function mysql_connect() in /var/www/status/config.php on line 31

I edited my php.ini and uncommented "extension=mysql.so", then restarted Apache but it still doesn't work.

I'm currently using Webmin to administrate my server. I heard somewehre about needing the line "--with-mysql" but I don't know what this means.

My PHPInfo file: http://www.dannyg.co.uk/info.php

Any help would be very very much appreciated,

Thanks in advance,

Daniel.

till
28th October 2006, 16:38
MySQL is not enabled in your PHP. Did you install the php-mysql pacakge from your linux distribution? Which php.ini did you edit?

dannyg
28th October 2006, 21:03
I did "apt-get install php5" and I installed MySQL via Webmin. The PHP works fine (hence the info.php page). Thats all I have installed as far as PHP and MySQL goes.

I edited the file in "/etc/php5/apache2/php.ini"

Thanks,

Daniel.

falko
29th October 2006, 14:51
I cannot access http://www.dannyg.co.uk/info.php ...

Does your PHP info page show that MySQL is enabled? Did you install the php5-mysql package?

sysconfig
3rd November 2006, 09:27
Yes, you are correct you could able to see the MySQL section in phpinfo page , you should have compatible php-mysql client also as suggest by other expert here.

However, sometime I have faced this issues after upgrading mysql I suggest you Put this into your my.ini file under the [MYSQLD] section:

old_password=1

and restart your mysql service and check.

Thanks,