Details Steps given below
When the page is loaded in the web browser, you receive the error, Fatal error: Call to undefined function mysql_connect().
- Verify that your installation of PHP has been compiled with mysql support. Create a test web page containing
and load it in your browser. Search the page for MySQL. If you don't see it, you need to recompile PHP with MySQL support, or reinstall a PHP package that has it built-in.
- Verify that the line to load the extension in
php.inihas been uncommented. In Linux, the line is
extension=mysql.soand in Windows, the line is
extension=php_mysql.dll. Uncomment the line by removing the semi-colon. You might also need to configure the
#sudo apt-get install php5-mysql
#sduo apt-get install php5-cgi
4. Then restart the mysql and apache
#sudo /etc/init.d/apache2 restart
#sudo /etc/init.d/mysql restart