The team at WordPress continues to encourage all users to run the latest and greatest versions of PHP. So if PHP 8.0 is fully supported, you may want to upgrade to it and make use of its newest features and enhancements that were released. At this moment, PHP 8.0 is not ready to be used with WordPress. WordPress 5.6 which is being released in a couple of weeks as of this date, might support it, but developers are still calling WordPress 5.6 “beta compatible” with PHP 8.0. If PHP 8.0 works with core WordPress functions, I doubt all themes and plugins will work without issues at this moment. If you haven’t installed WordPress, search our website to learn how to install it on Ubuntu.

Upgrade to PHP 8.0 with Nginx

If you’re running Nginx on Ubuntu to support WordPress, the steps below show you how to upgrade to PHP 8.0-FPM. This post assumes that you’re running PHP 7.4 or previous. Currently, Ubuntu does not have PHP 8.0-FPM packages available in its default repositories. To install the latest versions of PHP on Ubuntu you may have to add third-party repositories. Simply run the commands below to add the below repository to Ubuntu. Then update and upgrade to PHP 8.0-FPM Next, run the commands below to install PHP 8.0-FPM and related modules. After installing PHP 8.0-FPM, run the commands below to open the PHP default configuration file for Nginx. The lines below are a good setting for most PHP-based CMS… Update the configuration file with these and save. Every time you make changes to the PHP configuration file, you should also restart the Nginx web server and PHP script. To do so, run the commands below: After that, run the commands below to enable PHP 8.0 support for Nginx. Open the current WordPress virtual host site configuration file and enable the PHP block to use PHP 8.0-FPM. Ubuntu default site configuration file can be found at Then edit the PHP block session: After that, restart the Nginx HTTP server to use PHP 8.0-FPM. Finally, run the commands below to remove all PHP 7.4-FPM packages. Doing that will prompt you to accept the changes to your system. then type Y to continue. When you’re done, PHP 8.0-FPM should be enabled and PHP 7.4-FPM completely removed from Ubuntu. If you’re running PHP 7.3 or previously, replace 7.4 with your specific PHP version number to remove it from Ubuntu.

Upgrade to PHP 8.0 with Apache2

Skip the above steps if you’re running WordPress on an Apache2 HTTP server. Apache2 runs on PHP 8.0 while Nginx runs on PHP 8.0-FPM. Again, Ubuntu may not have PHP 8.0 packages available in its default repositories. To install PHP 8.0 on Ubuntu to support WordPress, you may need to run the commands below to add a third-party repository. After adding the repository above, update and install PHP 8.0 Next, run the commands below to install PHP 8.0 and related modules. After installing PHP 8.0, run the commands below to open the PHP default configuration file for Apache. The lines below are a good setting for most PHP-based CMS… Update the configuration file with these and save. For Apache2 and PHP 8.0, you must disable previous versions of PHP and enable Apache2 to use the latest version. First, run the commands below to disable PHP 7.4. Now that PHP 7.4 is disabled, run the commands below to enable PHP 8.0. After enabling PHP 8.0, run the commands below to restart Apache2 and PHP 8.0 should be used to support WordPress. Finally, run the commands below to remove all PHP 7.4 packages. That’s it!

Conclusion:

This post shows you how to upgrade to the latest PHP 7.4 to support WordPress sites on Ubuntu systems. If you find any error above, please use the comment form below to report it. You may also like the post below: