With the release of the latest version of PHP, PHP 8.0, we are facing new features and updates. One of the most important changes in this version is the inclusion of the JIT compiler for PHP. When it comes to PHP 8.0, user expectations are high. Because by offering the real-time option, which is one of the most important features of PHP8.0, it gives people the ability to not need to use several different programming languages in a project. In this article, we try to learn How to Install and Enable PHP 8 on CPanel. You can visit the packages available in Eldernode to purchase a VPS Hosting server.
Table of Contents
Tutorial Install and Enable PHP 8 on CPanel
Benefits and Features of PHP 8
Here are some of the features and benefits of PHP 8:
1. Support for union types: Union types allow you to assign multiple types to a single parameter, attribute, or return.
2. Just in Time (JIT) Compiler: The JIT compiler compiles parts of code and runtime to improve response time to your web pages.
3. Named Arguments: Named arguments to allow you to assign a name to the input data and call it in your code instead of the order of the argument.
4. Attributes: Attributes act as annotations in your PHP code, allowing you to add metadata.
Follow us in this article to learn how to install PHP 8 on Cpanel.
Install PHP 8 on CPanel
You can use PHP 8 (ea-php80) on the CPanel server by installing the EasyApache test repository. So you can easily use the following command to install the test repository:
yum install ea4-experimental
How to Enable PHP 8 on CPanel
Templates and plugins are compatible with newer PHP versions after being updated. However, in some cases, the PHP version is not compatible with some templates and plugins, and this incompatibility can cause problems for the site. Since templates and plugins are constantly being updated, learning to change the PHP version is essential for website owners. In this section, we are going to learn how to Enable PHP 8 or change the PHP version in Cpanel.
To change the PHP version, first, log in to CPanel. Then select the Select PHP Version option in the Software section. Note that this option may be “Multi PHP Manager” in some versions of CPanel.
After entering “Select PHP Version” you will see the page as shown below. To select the PHP version, click on the number in front of the PHP version option, ie 8, to select the desired version.
After selecting the PHP version, you can activate your plugins from the bottom if you wish. To do this, find the name of the plugin and then check the box next to it.
Finally, click “Set as current” to set the new version of PHP on the website. Now to make sure this version is compatible with your website, open your site homepage.
Note: If you encounter an error, try the other versions. If you want the settings to return to the original state, click on the Reset To Default option.
PHP 8 is a new version of the PHP programming language that, in addition to fixing the flaws and shortcomings of previous versions, has brought different features and capabilities. In this article, we tried to point out some of the unique features and possibilities that exist in PHP 8. Then we talked about how to install PHP 8 on Cpanel. If you want to install PHP 8 on the DirectAdmin control panel, you can refer to the Tutorial Install and Enable PHP 8 on Directadmin article.