PHP 8.0 is the latest major update to PHP. This version includes many new features and optimizations including named arguments, union types, attributes, build property upgrades, matching expression, null safe operator, JIT and system type improvements, error management, and compatibility. In this article, we try to introduce you to the Tutorial Install and Enable PHP 8 on Directadmin. You can visit the packages available in Eldernode to purchase VPS Hosting.
Table of Contents
How to Install and Enable PHP 8 on Directadmin
PHP 8 was officially released on November 26, 2020! This version offers a set of powerful optimizations and features. PHP 8 offers the most interesting changes and allows users to write better code and build more powerful programs. In the next section, we will mention some of the new features that this version offers. Then we learn how to install and Enable PHP 8 on Directadmin. Please be with us.
PHP Features 8
Here are some of the features and enhancements of PHP 8:
1. Saner String to Number Comparisons
2. Trailing Comma in Parameter List
3. Incompatible Method Signatures
4. Property Promotion
5. Saner Numeric Strings
6. Consistent Type Errors for Internal Functions
7. Stricter Type Checks for Arithmetic/Bitwise Operators
8. Validation for Abstract Trait Methods
9. Match Expression v2
10. Arrays Starting With a Negative Index
11. Named Arguments
12. Nullsafe Operator
Install PHP 8 on Directadmin
In this section, we will learn an easy way to install PHP 8 on a server with a Directadmin panel. To do this, just follow the steps below in order. In the first step, you must log in to the console as root. Then go to the directory:
cd /usr/local/directadmin/custombuild
Then you have to edit the configuration file using the nano editor:
nano options.conf
Now you need to use the following command to set PHP 8 as your desired version:
php4_release=8.0
Save the configuration file and exit it.
In this step, you must download the latest packages by executing the following command:
./build update
Finally, you need to compile PHP using the following command:
./build phpn
How to Enable PHP 8 on Directadmin
After you were able to install PHP 8 in the previous step, you must enable it in this section. After re-compiling, you have php8 available to choose from in your domain settings.
To set them up, go to the Directadmin Account admin panel and the domain configuration section and select your domain.
Finally, in the upper left, you have to select the PHP version.
Conclusion
In PHP 8 we see new changes that keep PHP in the list of languages worth learning and using. It also makes it more popular among developers. Perhaps one of the great changes to PHP is the JIT compiler, which makes PHP faster. In this article, we tried to introduce you to the Tutorial Install and Enable PHP 8 on Directadmin.