Step-by-Step Guide to Compile and Install PHP 8.0 Alpha on CentOS with JIT Testing
This article provides a concise, step‑by‑step tutorial for downloading, compiling, and installing PHP 8.0 Alpha 1 on a CentOS 7 system, configuring essential extensions, setting up PHP‑FPM, verifying the installation, and evaluating the new JIT feature with benchmark results.
This guide walks through the complete process of installing PHP 8.0 Alpha 1 on a CentOS 7.4 server, covering prerequisites, source download, extraction, configuration, compilation, installation, and post‑install verification, as well as a brief JIT performance test.
Prerequisites
Operating System: CentOS Linux release 7.4.1708 (Core)
GCC 4.8.5
PHP source version: php-8.0.0alpha1
1. Download source
$ wget https://downloads.php.net/~pollita/php-8.0.0alpha1.tar.gz2. Extract archive $ tar -zxvf php-8.0.0alpha1.tar.gz 3. Create installation directory $ mkdir -p /usr/local/php80 4. Configure build options
$ cd php-8.0.0alpha1 $ ./configure --prefix=/usr/local/php80/ --enable-debug --enable-fpm --with-config-file-path=/usr/local/php80/etc --with-config-file-scan-dir=/usr/local/php80/etc/php.d/If configuration fails, the guide lists two common errors (missing libxml2‑dev and sqlite3‑dev) and their resolutions:
yum install libxml2-devel.x86_64 yum install sqlite-devel.x86_645. Compile and install
$ make $ make installThe output confirms successful installation of binaries, extensions, and helper programs.
6. Verify PHP version $ /usr/local/php80/bin/php -v Expected output shows PHP 8.0.0alpha1 (cli) with DEBUG build.
7. Environment configuration
$ ln -s /usr/local/php80/bin/php /usr/bin/php80 $ cp php.ini-development /usr/local/php80/etc/php.ini $ cp /usr/local/php80/etc/php-fpm.conf.default /usr/local/php80/etc/phpfpm.conf $ cp /usr/local/php80/etc/php-fpm.d/www.conf.default /usr/local/php80/etc/php-fpm.d/www.conf $ cp sapi/fpm/init.d.php-fpm /etc/init.d/php80-fpm $ chmod +x /etc/init.d/php80-fpm8. Verify configuration paths $ php80 --ini Shows the correct php.ini and scan directory locations.
9. Start and test PHP‑FPM
$ /etc/init.d/php80-fpm start $ ps aux | grep php-fpm $ /etc/init.d/php80-fpm statusAll commands confirm that the FPM master and worker processes are running.
10. Simple PHP script test
// index.php <?php var_dump(PHP_VERSION); var_dump(PHP_VERSION_ID); $ curl localhostOutputs "8.0.0alpha1" and integer 80000.
11. JIT feature test
The author runs a benchmark (Zend/bench.php) on an 8‑core, 16 GB VM and observes minimal performance change when toggling JIT, illustrating the current state of the feature.
12. OPCache configuration
zend_extension=opcache
opcache.enable=1
opcache.enable_cli=1
opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=10000
opcache.revalidate_freq=10
opcache.save_comments=0Conclusion
The article presents a generic method for compiling PHP from source that can be adapted to other versions, highlights the importance of appropriate configure options and required libraries, and shares a brief JIT performance observation, directing readers to additional resources on PHP 8 JIT.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
360 Tech Engineering
Official tech channel of 360, building the most professional technology aggregation platform for the brand.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
