Hi, I want to share this with all of you, today my server suddenly start showing this. Fatal error: Call to undefined function: mysql_connect()

What I had to do is


apt-get install php4-mysql

after that

dpkg-reconfigure php4-mysql

Edit: 12/15/2010

You may want to run instead of the above commands:

apt-get install php5-mysql


dpkg-reconfigure php5-mysql

If you want to use php5 instead of php4.

————————– Then you can continue ———-

and finaly.

/etc/init.d/mysql restart


/etc/init.d/apache2 restart

I don’t know why if it was working before, suddenly stop working, my PHP application (like this one) but it did.