php5.6.40编译安装

警告
本文最后更新于 2020-12-10 11:07,文中内容可能已过时。
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
wget https://www.php.net/distributions/php-5.6.40.tar.gz

tar xf php-5.6.40.tar.gz

cd php-5.6.40/

yum install -y openssl-devel libxml2 libxml2-devel bzip2 bzip2-devel  libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel mcrypt libmcrypt libmcrypt-devel

./configure --prefix=/application/php5.6.40 --enable-fpm --enable-mysqlnd --with-mysql=/application/mysql --with-pdo-mysql=/application/mysql --with-mysqli=/application/mysql/bin/mysql_config --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-bz2 --with-openssl --with-mcrypt --enable-soap --enable-mbstring --enable-sockets --enable-exif --with-config-file-path=/application/php5.6.40/etc/

make && make install

ln -s /application/php5.6.40/ /application/php

cp php.ini-production /application/php5.6.40/etc/php.ini

cp sapi/fpm/php-fpm.service /etc/systemd/system/php-fpm.service

sed -i 's#${prefix}#/application/php#' /etc/systemd/system/php-fpm.service
sed -i 's#${exec_prefix}#/application/php#' /etc/systemd/system/php-fpm.service

mv /application/php5.6.40/etc/php-fpm.conf{.default,}

#修改php-fpm用户
vim /application/php5.6.40/etc/php-fpm.conf

systemctl start php-fpm
请我喝杯水
SoulChild 微信号 微信号
SoulChild 微信打赏 微信打赏
0%