PHP · 2023年7月6日 0

PHP-install

php-frm Compile Installation 7.4.11
1、yum -y install gcc openssl-devel libxml2-devel bzip2-devel libmcrypt-devel sqlite-devel oniguruma-devel

2、cd /usr/local/src

wget https://www.php.net/distributions/php-7.4.11.tar.xz

3、tar xf php-7.4.11.tar.xz

4、./configure –prefix=/apps/php74 –enable-mysqlnd –with-mysqli=mysqlnd –with-pdo-mysql=mysqlnd –with-openssl –with-zlib –with-config-file-path=/etc –with-config-file-scan-dir=/etc/php.d –enable-mbstring –enable-xml –enable-sockets –enable-fpm –enable-maintainer-zts –disable-fileinfo

5、make -j $CPU && make install

6、cp /usr/local/src/php-7.4.11/php.ini-production /etc/php.ini

cp /usr/local/src/php-7.4.11/sapi/fpm/php-fpm.service /usr/lib/systemd/system/

cd /apps/php74/etc
cp php-fpm.conf.default php-fpm.conf
cd php-fpm.d/
cp www.conf.default www.conf
vim www.conf

grep ‘^[^;]’ www.conf
[www]
user = www
group = www
listen = 127.0.0.1:9000
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
pm.status_path = /pm_status
ping.path = /ping
access.log = log/$pool.access.log
slowlog = log/$pool.log.slow

7、useradd -r -s /sbin/nologin www

8、mkdir /apps/php74/log

9、cp /usr/local/src/php-7.4.11/sapi/fpm/php-fpm.service /usr/lib/systemd/system/

10、systemctl daemon-reload

11、systemctl enable –now php-fpm