[PHP] 最新抢先编译安装PHP8.0.0 alph1以及FPM [PHP] 源码编译安装opcache[PHP] php8的jit不支持32位系统WARNING: JIT not supported by host architecture[PHP] 查找使用的哪个配置文件php.ini[转载] PHP 8新特性之JIT简介

前端之家收集整理的这篇文章主要介绍了[PHP] 最新抢先编译安装PHP8.0.0 alph1以及FPM [PHP] 源码编译安装opcache[PHP] php8的jit不支持32位系统WARNING: JIT not supported by host architecture[PHP] 查找使用的哪个配置文件php.ini[转载] PHP 8新特性之JIT简介前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

(麻烦各位转载请注明出处和地址:陶士涵的菜地,谢谢 --2020年6月28日)

所有操作需要在root用户
本机测试案例系统信息:ubuntu
安装路径:/usr/local/PHP8

 

 

解压缩:

wget https://downloads.PHP.net/~pollita/PHP-8.0.0alpha1.tar.gz

tar -zxvf PHP-8.0.0alpha1.tar.gz

cd PHP-8.0.0alpha1/

 

编译:

./configure --prefix=/usr/local/PHP8 \
--with-config-file-path=/usr/local/PHP8 \
--enable-mbstring  \
--enable-ftp  \
--enable-gd   \
--enable-gd-jis-conv \
--enable-MysqLnd \
--enable-pdo   \
--enable-sockets   \
--enable-fpm   \
--enable-xml  \
--enable-soap  \
--enable-pcntl   \
--enable-cli   \
--with-openssl  \
--with-MysqLi=MysqLnd   \
--with-pdo-MysqL=MysqLnd   \
--with-pear   \
--with-zlib  \
--with-iconv  \
--with-curl  \

make && make install

有依赖错误的,需要搜索解决一下

复制配置文件

cp PHP.ini-production /usr/local/PHP8/PHP.ini

打开错误

vim /usr/local/PHP8/PHP.ini
display_errors = On

 

复制fpm的启动脚本:

cp ./sapi/fpm/init.d.PHP-fpm /etc/init.d/PHP-fpm8.0

增加执行权限

chmod +x /etc/init.d/PHP-fpm8.0

修改PHP-fpm配置文件

cd /usr/local/PHP8/etc

cp PHP-fpm.conf.default PHP-fpm.conf

vim PHP-fpm.conf

去掉 pid = run/PHP-fpm.pid 前面的分号

修改启动用户

user = www-data
group = www-data

 

修改监听端口:

listen = 127.0.0.1:9080

 

配置Nginx:

server {
        listen          80; 
        server_name  test.sopans.com;
        access_log  /var/log/Nginx/test.sopans.com.access.log  main;
        root   /var/www/html/test;
        index  index.html index.htm index.PHP;

        location ~ \.PHP {
                fastcgi_pass   127.0.0.1:9080;
                fastcgi_index  index.PHP;
                fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
#               fastcgi_split_path_info ^(.+\.PHP)(/.*)$;
#               fastcgi_param PATH_INFO $fastcgi_path_info;
                include        fastcgi_params;
        }   

}  

启动fpm

/etc/init.d/PHP-fpm8.0 start   

访问:

 

因为jit是绑定在opcache扩展里面的,所以需要编译安装opcache扩展

[PHP] 源码编译安装opcache

[PHP] php8的jit不支持32位系统WARNING: JIT not supported by host architecture

查看使用的哪一个配置文件

[PHP] 查找使用的哪个配置文件php.ini

 

PHP8的JIT机制优化了zend引擎处理执行opcode的流程,不需要每次都解释执行,直接执行opcode编译成的机器码

[转载] PHP 8新特性之JIT简介

 

猜你在找的PHP相关文章