


PHP 8.0 source code compilation and installation and JIT early adopter
Special Skills Guide
PHP 8.0 Alpha 1 has been released on June 25, 2020. Today I will share with you the most simplified PHP 8 Source code compilation and installation method to quickly try out the new feature JIT of PHP 8.0.
Operating system: CentOS Linux release 7.4.1708 (Core)
GCC: 4.8.5 20150623 (Red Hat 4.8.5-28 )
PHP version: php-8.0.0alpha1
1. Download page
1 |
|
2. Download PHP 8.0
1 |
|
3. Unzip
1 |
|
4. Create a new installation directory
Since multiple PHP versions coexist on this machine, it is necessary to create a meaningful directory, a directory name that can be known without thinking about the PHP version.
1 |
|
5. configure options
This is a simplified version of the configuration options, a richer description of PHP configuration options: https://www.php.net/manual /en/configure.about.php
1 2 |
|
If you encounter the prompt configure: error during the configure process, pay attention to the error details below. The following lists a summary of key information for error conditions that occur during the configuration process. For other error conditions not listed, the solutions are the same:
Error #1:
1 2 |
|
Solution:
1 |
|
Error #2:
1 2 |
|
Solution:
1 |
|
If you see the following prompt message, it means that the configure step has been successful.
6. Compilation & Installation
1 |
|
The time consumed in the make phase is related to the machine configuration. If you see the following information, Indicates that the make phase has been completed.
1 2 |
|
make test Since this is an early adopter, this step is omitted.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
|
7. Verify PHP
1 2 3 4 |
|
8. Environment configuration
1 2 3 4 5 6 |
|
9. Verify configuration path
Verify whether the customized configuration items take effect: --with-config-file-path, --with-config-file-scan-dir
1 2 3 4 5 |
|
10, Start FPM
1 2 |
|
11. Verify FPM
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
The Nginx configuration details are omitted here, mainly to quickly test whether the installed PHP-FPM mode is available of.
1 2 3 4 |
|
1 2 3 |
|
12. Try new features JIT
Machine configuration: 8-core 16G, SATA disk, operating system: CentOS Linux release 7.4.1708 (Core)
Zend OPCache (/usr/local/php80/etc/php.ini) is configured as follows. Most of the [opcache] configuration items have default values. In order to highlight the importance of these configuration items, they are listed:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
|
This is a virtual machine with idle resources. After repeatedly turning on JIT and turning off JIT many times, the test results show that there is almost no change in the result value. The test results did not specifically select the most beautiful data. In fact, there is no need. As shown in the figure below:
13. Summary
This is a general PHP source code compilation and installation method. Other PHP versions can be compiled The installation method is similar. In actual business applications, the configure options are much richer, and the class libraries that need to be installed will be more comprehensive. In this article, the new feature JIT of PHP 8 is tested. According to the test results of Zend/bench.php, it is still eye-catching. For an introduction to PHP 8 JIT, we recommend "PHP8 New Features JIT Usage Introduction".
Recommended article: "PHP8.0"
The above is the detailed content of PHP 8.0 source code compilation and installation and JIT early adopter. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

The differences between php5 and php8 are in terms of performance, language structure, type system, error handling, asynchronous programming, standard library functions and security. Detailed introduction: 1. Performance improvement. Compared with PHP5, PHP8 has a huge improvement in performance. PHP8 introduces a JIT compiler, which can compile and optimize some high-frequency execution codes, thereby improving the running speed; 2. Improved language structure, PHP8 introduces some new language structures and functions. PHP8 supports named parameters, allowing developers to pass parameter names instead of parameter order, etc.

The steps to add mysql extension to php8 are: 1. Install the MySQL client library; 2. Install the development tools for PHP 8; 3. Download the MySQL extension source code; 4. Compile and install the MySQL extension; 5. Enable the MySQL extension; 6. Restart Just a web server.

This article will introduce to you how to install apache2.4 and how to configure php8.0. The article is accompanied by pictures and detailed steps. Let's take a look at how to install and configure apache2.4+php8.0~

PHP8 can use mysqli and PDO to connect to the database. Detailed introduction: 1. Use mysqli to connect to the database by passing in the database server name, user name, password and database name to connect. Then, use the `connect_error` attribute to check whether the connection is successful and output an error message if the connection fails. Finally, close the connection by calling the `close()` method; 2. Use PDO to connect to the database, and connect by passing in the database server name, password and database name, etc.

The methods of the php8 data type include converting strings to integers, converting integers to strings, converting strings to floating point numbers, converting floating point numbers to strings, converting arrays to strings, converting strings to arrays, and converting Boolean values to integers. Integer conversion to Boolean value and variable type determination and conversion. Detailed introduction: 1. Converting a string to an integer includes the intval() function and (int) forced type conversion; 2. Converting an integer to a string includes the strval() function and (string) forced type conversion; 3. Converting a string to a float Points and so on.

This article will take you through the JIT in PHP 8 and talk about how JIT participates in the interpretation process. I hope it will be helpful to everyone!

The improved performance of php8 includes: 1. Introduction of JIT compiler; 2. Optimization of function calls; 3. Improvement of garbage collection mechanism; 4. Improvement of type system; 5. New language features; 6. Optimized string processing; 7. Improve array processing; 8. Introduce a new memory management mechanism; 9. Optimize code generation. Detailed introduction: 1. The introduction of the JIT compiler. PHP8 introduces the JIT compiler, which is a dynamic compilation technology that can convert PHP code into machine code for more efficient execution; 2. Optimization of function calls, etc.

Unlock PHP8’s JIT technology: Optimize your code execution speed With the release of PHP8 at the end of 2020, one of the most exciting new features is the introduction of JIT (Just-in-Time) compiler technology. JIT technology can significantly improve the execution speed of PHP code, especially those code fragments with intensive calculations and loops. In this article, we will explore how to use PHP8's JIT technology to optimize code execution speed, while providing some specific code examples. 1. What is a JIT compiler? J
