在ubuntu中出现Call to undefined function: mysql_connect()

这说明你的php不能和mysql正常连接。这个原因在于:
你少装了一个包。ubuntu下依次运行
sudo apt-get install php5-mysql

sudo dpkg-reconfigure php5-mysql
sudo /etc/init.d/mysql restart
sudo /etc/init.d/apache2 restart

原文地址:https://www.cnblogs.com/suihui/p/2660311.html