php安装

一、安装依赖
yum install libxml2-devel sqlite-devel libcurl-devel oniguruma-devel libpng-devel libjpeg-devel freetype-devel libzip-devel openssl-devel -y

二、编译

wget https://www.php.net/distributions/php-7.4.30.tar.gz
tar xf php-7.4.26.tar.gz
cd php-7.4.26

./configure --prefix=/usr/local/php7 --with-config-file-path=/usr/local/php7 --enable-sockets --enable-fpm --enable-cli --enable-mbstring --enable-pcntl --enable-soap --enable-opcache --disable-fileinfo --disable-rpath --with-mysqli --with-pdo-mysql --with-iconv-dir --with-openssl --with-fpm-user=www --with-fpm-group=www --with-curl --with-mhash --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --enable-zip --with-zlib --enable-simplexml --with-libxml-dir

make && make install

三、复制默认配置文件

cp sapi/fpm/init.d.php-fpm /usr/local/php7
cp php.ini-production /usr/local/php7/etc/php.ini

cd /usr/local/php7/etc
cp php-fpm.conf.default php-fpm.conf

cd /usr/local/php7/etc/php-fpm.d
cp www.conf.default www.conf

启动php
sh /usr/local/php7/init.d.php-fpm start
或者
重启 php-fpm
pkill -9 php-fpm
/usr/local/php7/sbin/php-fpm

你可能感兴趣的:(php安装)