How to change php version in joomla

For Web Hosting packages

In this article, we will show you how to change the PHP version running your Joomla! website and what to consider when switching to a newer PHP version.

What is PHP?

PHP is a programming language that runs on the web server. It is mainly used to create dynamic web pages or web applications. For example, all Joomla! websites run on PHP.

When does it make sense to change my version of PHP?

Like Joomla!, PHP is constantly being developed and improved. For Joomla! website administrators, one of the following situations can occur which requires changing to a different PHP version:

  • A Joomla! update requires a newer version of PHP.
  • A certain version of PHP is outdated and should not be used anymore.
  • A new version of PHP is available, and you want to take advantage of the performance enhancements.

Which PHP version should I use?

You can choose between a few different PHP versions. If there is no particular reason to use a certain version, you should use the recommended version. Currently this is PHP 8.0. With this version, you can use the most popular and tested applications without having to worry about compatibility problems.

Preparing and Changing the PHP Version

Technically, you only need a few mouse clicks to migrate your domain - and thus your website - to a new PHP version. However, it is possible that the Joomla! version you use, individual plugins, or your website's theme are not yet fully compatible with the new PHP version. In order to avoid any problems that may pop up, it is highly recommended that you prepare the website for the changes ahead of time, and then you can change the PHP version. We suggest that you follow these steps when switching to a new PHP version:

    • Create a Backup

      Before you change the PHP version, you should make a backup of your Joomla! website. If you don't have your own backup method yet, try using the free Akeeba Backup Plugin. Akeeba Backup is an easy-to-use open source backup solution that allows you to create a full backup of your website.

    • Update Joomla!

      The older your Joomla! version is, the more likely it is that the PHP code used is no longer compatible with the new PHP version. Please check if updates for your Joomla! version, plugins and the theme are available. Unless you need to use an older version for some reason, you should always keep your Joomla! installation and all components up to date. Additionally, these updates also regularly close security vulnerabilities.

    • Check Theme and Plugin Compatibility

      If you are using third-party plugins, you can check in advance if it is compatible with the future PHP version. Open the page https://extensions.joomla.org/ and search for the corresponding plugins. On each page, click the Support button and check the page information about the PHP version. This may also be hidden under the Requirements link,
    • Change the PHP Version

      After you have made all of the preparations, you can change your domain to the desired PHP version. Activating the new PHP version only takes a few minutes. Click here to find out how to change the PHP version for your domain
    • Check the Website for Errors

      As soon as the new PHP version is active, you should immediately check the website thoroughly:
      - Is the website accessible?
      - Are all subpages accessible?
      - Do all sliders, galleries, forms, etc. still work?
      - Does the backend (administration area) work?

    Additional Notes

    If there are problems with the new PHP version, it is recommended that you check all plugins again for compatibility. You may need to uninstall or replace incompatible plug-ins with other plug-ins that work.

    In order to restore the availability of the website or the backend as quickly as possible in the event of a problem, you can switch the domain back to the previous PHP version. Please note that it may take a few minutes after the change for this PHP version to become active again. If errors occur with the old version as well, you will have to restore your website from the backup.


    Updating PHP[edit]

    If you’ve logged into your Joomla Administrator area and have been greeted with a message like the one below, don’t panic. Joomla has a recommended minimum PHP requirement at the time of writing of PHP 7.3 or higher. The current official release of PHP is version 7.4. In addition to the PHP Version Check message that can appear if you’re using a version of PHP lower than 7.3, Joomla 3.10 will have a PHP warning message about PHP versions before you attempt to migrate to Joomla 4 when it is released.

    How to change php version in joomla

    With Joomla 4 a large amount of previous legacy code has been removed. At the same time, a lot of new modern code has been added. Having the correct version of PHP is going to be essential for Joomla 4 to work, as the new code utilises the improved features and functions PHP 7.3+ provides.

    Technical Requirements for Joomla[edit]

    There are a range of technical requirements recommended for hosting Joomla sites. The Production Department review the requirements from time to time, and so you should reference the Joomla Downloads site for current Technical Requirements.

    Though the PHP minimum requirement is 5.3.10, many Joomla extensions additionally have features that may push up the minimum required version of PHP need. Should you get a white screen of death when trying to use Joomla on PHP 5.x, it is highly likely that an installed extension is not compatible with PHP 5.x and the easiest solution would be to upgrade your PHP to a currently supported version of PHP.

    Updating your PHP Version[edit]

    There's a variety of ways to update your PHP version. The main ones are covered in an article in the September 2020 issue of Joomla Community Magazine: How do I update my PHP version?.

    If you have additional notes on updating your PHP Version, please contribute them here.

    Troubleshooting Tips[edit]

    PHP is a server-level application layer. So this means that when something goes wrong, it really goes wrong, and most commonly brings your website down with a number of errors.

    Over time I’ve only encountered a handful of errors when switching PHP versions, and the two most common (both which I triggered while creating screenshots for this article) are:

    • 503 Error - Service Unavailable - A 503 error may occur temporarily while the server changes settings for your account. If it continues to display after a few minutes, revert the version change you made.
    • 502 Error - Bad Gateway - 502 errors are a permanent issue when they occur. Usually, it means that the change you made is not compatible with the settings on the server. I triggered a 502 error when changing the Plesk version, as instead of keeping the “run PHP as” option set to what it was originally set to. Changing the setting to match the original setting cleared the 502 error.

    How do I update my Joomla PHP version?

    Preparing and Changing the PHP Version.
    Create a Backup. Before you change the PHP version, you should make a backup of your Joomla! ... .
    Update Joomla! The older your Joomla! ... .
    Change the PHP Version. After you have made all of the preparations, you can change your domain to the desired PHP version. ... .
    Check the Website for Errors..

    How do I change my PHP version?

    Changing the PHP version.
    Navigate to the Manage Websites page..
    Click the Manage button to the right of your domain..
    Under the PHP section, click the Modify icon..
    Choose a version of PHP from the dropdown menu..
    Scroll down and click the Change PHP Version button to save your changes..

    What PHP version does Joomla use?

    Joomla has a recommended minimum PHP requirement at the time of writing of PHP 7.3 or higher. The current official release of PHP is version 7.4.

    How can I update PHP version in PHP project?

    Log in to cPanel. Select MultiPHP Manager in the Software section. Select the domain you want to upgrade by checking the box on its left side. Choose 7.4 or select the newest PHP version from the dropdown, then click Apply.