php7.4 注意事项

1、编译,带with-pear ,make的时候会自动安装,不用管告警

先装依赖包

yum -y install libxml2 libxml2-devel openssl openssl-devel curl-devel libjpeg-devel libpng-devel freetype-devel libmcrypt-devel libzip-devel pcre-devel sqlite-devel epel-release bzip2-devel gmp-devel readline-devel oniguruma-devel net-snmp-devel libxslt-devel unixODBC-devel

 

./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-mysqlnd --with-mysqli --with-pdo-mysql --enable-fpm --with-fpm-user=nginx --with-fpm-group=nginx --with-curl --with-freetype --enable-gd --with-jpeg --with-gettext --with-gmp --with-mysqli --with-openssl --with-pdo-mysql --with-pear --with-xmlrpc --with-xsl --with-mhash --enable-fpm --enable-bcmath --enable-mbstring --enable-sockets --enable-xml --enable-embed --enable-phpdbg --with-snmp --with-bz2 --enable-calendar --with-curl --enable-exif --enable-ftp --enable-pcntl --with-zlib --with-readline --enable-shmop --enable-sockets

2、最坑的地方,php.ini文件的读取路径用phpinfo()函数看不准,最好用命令php --ini

3、检验pear工作状态,参考https://pear.php.net/manual/en/installation.checking.php

4、php-fpm以socket方式提供服务,修改www.conf

listen = /var/run/php-fpm.socket

listen.mode = 0666

同时,nginx中把

fastcgi_pass 127.0.0.1:9000;改成fastcgi_pass   unix:/var/run/php-fpm.socket;即可

5、nginx中location的配置为

location ~ \.php$ {
fastcgi_pass unix:/var/run/php-fpm.socket;
#fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}

 

posted @ 2022-05-31 13:25  swordzj  阅读(73)  评论(0编辑  收藏  举报