php5.6.3 源码安装

php5.6.3 源码安装
1 安装依赖库

yum install -y autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libpng libpng-devel libxml2 libxml2-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel curl curl-devel gdbm-devel db4-devel libXpm-devel libX11-devel gd-devel gmp-devel readline-devel libxslt-devel expat-devel php-mcrypt libmcrypt libmcrypt-devel

2 下载源码

https://www.php.net/releases/
链接:https://pan.baidu.com/s/1C0kf_i7ObTXUAgWUu0piiw 密码:m526

3 安装
下载后解压源码,进入目录,执行如下命令安装。

./configure --prefix=/usr/local/php/ --localstatedir=/usr/local/var --sysconfdir=/usr/local/php/ --with-config-file-path=/usr/local/php/ --with-config-file-scan-dir=/usr/local/php/ --with-pear=/usr/local/php/pear --enable-bcmath --enable-calendar --enable-dba --enable-exif --enable-ftp --enable-fpm --enable-intl --enable-mbregex --enable-mbstring --enable-mysqlnd --enable-pcntl --enable-phpdbg --enable-shmop --enable-soap --enable-sockets --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-zip --with-curl --with-fpm-user=www --with-fpm-group=www --with-freetype-dir=/usr/local/freetype --with-gd --with-gettext=/usr/local/gettext --with-jpeg-dir=/usr/local/jpeg --with-mcrypt --with-mhash --with-mysqli=mysqlnd --with-mysql=mysqlnd --with-openssl --with-pdo-mysql=mysqlnd --with-pic --with-png-dir=/usr/local/libpng --with-xmlrpc

4 安装扩展
根据自己的项目需要 安装phpredis等扩展。

原文地址:https://www.cnblogs.com/walkersss/p/15420461.html