Surviving the cPanel 11.40 Update

Have you logged into Web Host Manager (WHM) on your cPanel server recently? Perhaps you've seen this little message on your home screen:

“The last attempt to update WHM and cPanel has been blocked”

You might also be getting a notification every day that the cPanel updater is failing. Don’t worry, this is actually normal. cPanel’s latest stable release, 11.40, requires that the MySQL Database Server be updated to at least 5.1.x before cPanel can update normally to 11.40. Keep in mind that the update process has changed somewhat for MySQL, so here is some technical guidance to help you get through the cPanel update smoothly. As always, if you have general server management, you can open a support ticket in LEAP3 for assistance.

Updating MySQL

cPanel uses MySQL RPMs (packages) directly from Oracle’s repository. This is also why on cPanel servers, the service name is mysql instead of mysqld. Although the update process for MySQL is the same in WHM (Home > Software > MySQL Upgrade), a lot of the underlying mechanics have changed, which are good to know in case the update method in WHM doesn’t work for you. First, I would recommend you backup your existing MySQL databases. The simplest way to do this is just use mysqldump on the command line when logged into your cPanel server as root over SSH:

mysqldump --all-databases > /path/to/dump_filename.sql

Once the DBs are backed up, you will need to tell cPanel to set the MySQL version to 5.1 or greater. You can do this by editing the cPanel configuration file manually, which is located at /var/cpanel/cpanel.config. Simply change the line:

mysql-version=5.0

To

mysql-version=5.1

Once changed, you can then run the following command to force cPanel to check for new RPMs from its internal repository

/scripts/check_cpanel_rpms --fix

This will have cPanel download and upgrade MySQL. You may want to pay attention to the output for any errors. You can verify MySQL has upgraded successfully with the command:

mysql -V

After upgrading MySQL, you may find that your PHP scripts may break when connecting to MySQL. This is because PHP is compiled from source by cPanel, and when compiling the MySQL PHP module it compiles against the client libraries provided by MySQL. With MySQL upgraded, the PHP module needs to be recompiled against the updated libraries.

Recompiling Apache/PHP

This step is actually very simple. You can use the following command to rebuild Apache/PHP with the exact same configuration as before, and it will be sure to rebuild the MySQL PHP module against the new MySQL client libraries:

/scripts/easyapache --build

This process usually takes 15-30 minutes depending on the processing power of your server. After the process completes, you can verify that PHP is running fine with this command:

php -v

Note that if you upgrade MySQL within WHM, it should automatically perform this rebuild for you during the MySQL Upgrade process.

Updating cPanel

After you upgrade MySQL and rebuild Apache/PHP, cPanel should automatically update during the next scheduled update check (usually around midnight on your servers’ local timezone). If you wish to force an update right away, you can run the following command:

/scripts/upcp --force

After the update has completed, you can verify it completed by checking the cPanel version file located at:

/usr/local/cpanel/version

Again, if you have any issues getting cPanel updated to 11.40, please open a support ticket. Even if you do not have server management, we can open a support case with cPanel on your behalf.