← ServerPilot Docs

How to Resolve 'Call to undefined function mysql_connect()'

After upgrading your app to PHP 7+, there is a very slim chance you will receive the following error:

Fatal error: Uncaught Error: Call to undefined function mysql_connect()

This is due to the removal of the mysql_connect function from PHP 7+.

If you receive that error, it means some of your app's code, such as a WordPress plugin or theme, is not compatible with PHP 7+.

To resolve this error, simple switch the app to PHP 5.6 until the code is updated to work with PHP 7+.

First, open your app's Settings tab in ServerPilot.

Then, click the blue pencil next to your current PHP version.

Select PHP 5.6 from the drop-down list and click Update.

Last updated: January 26, 2017

Launch your first site in 5 minutes