Hướng dẫn joomla 3.10 php version
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. Show
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:
Speed, security, compatibility, performance. These are just four of the reasons you should keep your PHP version up to date. In this 2020 revision on the topic, we cover a number of ways you can go about updating your PHP version to avoid problems in the lead up to the release of Joomla 4 which has a minimum requirement of PHP version 7.3 or above. I’m getting a warning in Joomla about my PHP version not being supported when I log in as Administrator. Help!?!If you’ve logged into your Joomla Administrator area and have been greeted with a message like the one above, 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. 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. Recommended PHP Version and Technical Requirements for JoomlaCurrently, Joomla 3 has a minimum PHP version technical requirement of 5.3.10, and since Joomla 3.5 was released in April 2016, the recommended version of PHP to be used for Joomla has been PHP 7. Since November 2019, the recommendation has been PHP 7.3+. There’s a big reason behind the recommended version now being PHP 7.3+, and that’s due to PHP versions lower than 7.3 having reached end of life. So if your website is still using PHP 5.6 or earlier, or PHP 7.2 or earlier, then the possibility that your website will encounter compatibility issues with updates, or security issues due to vulnerabilities that can be exploited is much higher. If your hosting provider is not providing you with the ability to use PHP 7.4 currently, then ask them why, and if they can’t, consider whether your hosting is working well for you. Updating your PHP VersionThere are a variety of ways to change your PHP version on your hosting, and it comes down mainly to which hosting platform your hosting provider is using. Two of the most common hosting platforms available today are cPanel and Plesk, and so we’ll cover where you can typically find options to change your PHP version if your hosting provider has made that option available to you. If you use cPanel or Plesk and the settings outlined below are not available to you, contact your hosting support as they might have disabled the functionality in shared hosting accounts on their servers. If your hosting uses a custom control panel interface, then you may need to contact your hosting support to ask them to change the version of PHP available. Upgrading PHP version in cPanel with EasyApache MultiPHP
Upgrading PHP version in cPanel with CloudLinux LVE
Upgrading PHP Version in Plesk
Setting PHP version using AddHandler in .htaccess fileYou can also use .htaccess files in Apache to switch your PHP version. You might find that in changing the cPanel PHP version, the following lines are added to your .htaccess automatically. After changing cPanel to PHP 7.4 in the steps above, my .htaccess file now has the following contents: What this line does is tell the server how to handle PHP files, by using a MIME Type to define the application version of PHP to use. AddHandler application/x-httpd-ea-php74 .php .php7 .phtml You can add a variation to your .htaccess file to switch PHP versions if your server supports that setting, and you already have other PHP versions installed. Updating PHP version on a VPS or Dedicated ServerIf you’re a server administrator or have your own VPS or Dedicated Server that you have root admin privileges for, you will usually be able to update your PHP version by adjusting the server settings. If you’re not confident about making changes to your server, your provider’s support staff should be able to assist you with making the necessary changes. Here are a number of resources on how to do that for different installations. Update your WHM/cPanel server using EasyApache4The simplest way to upgrade WHM so that the server has the latest version of PHP available, run EasyApache4 to update your Apache version, PHP versions and related modules. Find out more… Update your Plesk Server to install an additional PHP versionYou can add additional PHP versions to Plesk via either the Plesk Administration interface for your server or via the command line interface. Find out more... Updating PHP version on your local LAMP installationIf you’ve installed a test environment locally on your computer (See June’s Joomla Community Magazine article Installing a Test Environment), the best way to install a new version of PHP would be to update your LAMP installation. New versions of various installers are regularly released that support the latest versions of PHP, and typically you can install the update and your versions will be updated automatically.
Troubleshooting TipsPHP 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:
You can find (and contribute) additional troubleshooting tips on the Updating PHP page in JDOCs. An alternative that is not recommendedJoomla 3.9 will work on PHP 7.2 and above, but as mentioned at the start of the article, you will get a warning message if your PHP version is below the current required version. Often upgrading PHP may not be done straight away, though I hope you can see how easily it can be done if you’re with a quality hosting company. Joomla administrators may feel uncomfortable when they PHP warning messages, and so there is a way to disable the PHP version check, though upgrading PHP and keeping Joomla also updated should be your preferred path. Here’s how to disable the PHP Version Check message:
Further ResourcesThe variety of available server configurations means that covering every variation in a magazine article is not practical. To allow for other methods to be documented, a page on JDOCs has been created. Please contribute further methods and troubleshooting tips on the Updating PHP page in JDOCs. This article updates the information previously available in one of the Joomla Community Magazine's most visited articles How to upgrade your website PHP version by Parvez Akther from May 2016. |