centos7安装php5.3

2019-03-13 15:34:25       xhs
到官网下载php5.3,先用浏览器下载,因为会让你选择哪里的服务器下载
http://jp2.php.net/distributions/php-5.3.28.tar.bz2
下完上传到服务器
解压
tar -jxvf php-5.3.28.tar.bz2 
yum install -y gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libpng libpng-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses curl openssl-devel gdbm-devel db4-devel libXpm-devel libX11-devel gd-devel gmp-devel readline-devel libxslt-devel expat-devel xmlrpc-c xmlrpc-c-devel
cd php-5.3.28
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-fpm --enable-sysvsem --enable-sockets --enable-pcntl --enable-mbstring --enable-mysqlnd --enable-shmop --enable-zip --enable-ftp --enable-gd-native-ttf --enable-wddx --enable-soap
make
make test
make install
/usr/local/php/bin/php -v
cp /root/php-5.3.28/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm53
chmod +x /etc/init.d/php-fpm53
chkconfig --add php-fpm53
chkconfig --level 35 php-fpm53 on
cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
#因为已经跑了php7的fpm了,所以php5.3的先改个端口,
vim /usr/local/php/etc/php-fpm.conf
      listen = 127.0.0.1:9001
service php-fpm53 start

参考:https://www.cnblogs.com/wujf-myblog/p/9598515.html

发表评论