Plesk

Website hosted on Plesk server does not work after switching to PHP 7.x: Call to undefined function mysql_connect()

Symptoms

Cause

The PHP function mysql_connect() was removed in PHP 7.0.0.

Resolution

Plesk on CentOS/RHEL/CloudLinux/Virtuozzo Linux 7 and on Windows Server

  1. Log into Plesk.

  2. Go to Domains > example.com > PHP Settings.

  3. Switch PHP version to 5.x:

    Note: If PHP 5.x is not available for selection, install it using Plesk Installer.

Plesk on other Linux OS (CentOS/RHEL/CloudLinux 8, Debian 9/10, Ubuntu 18.04/20.04, AlmaLinux)

On these operating systems, PHP 5.x (and, in some cases, PHP 7.0) cannot be installed because system libraries are not compatible with these outdated and not supported PHP versions.

In this case, use one of the below solutions:

Exit mobile version