本文使用php5.5.38 系统为centos6.9
链接:https://pan.baidu.com/s/1DzdFHvKt8cHQAcfj7dEfBA 提取码:q94t
1,php安装依赖下载 yum install zlib-devel libxml2-devel libjpeg-devel libjpeg-turbo-devel libiconv-devel -y yum install freetype-devel libpng-devel gd-devel libcurl-devel libxslt-devel libxslt-devel -y yum -y install libmcrypt-devel mhash mcrypt
2,创建php用户 useradd -s /sbin/nologin -M www
3,解压安装包 tar xf php-5.5.38.tar.gz
4,进入安装包 cd php-5.5.38
5,编译安装配置 ./configure –prefix=/data/php5.5.38 –enable-mysqlnd –with-mysql=mysqlnd –with-pdo-mysql=mysqlnd –with-freetype-dir –with-jpeg-dir –with-png-dir –with-zlib –with-libxml-dir=/usr –enable-xml –disable-rpath –enable-safe-mode –enable-bcmath –enable-shmop –enable-sysvsem –enable-inline-optimization –with-curl –with-curlwrappers –enable-mbregex –enable-fpm –enable-mbstring –with-mcrypt –with-gd –enable-gd-native-ttf –with-openssl –with-mhash –enable-pcntl –enable-sockets –with-xmlrpc –enable-zip –enable-soap –enable-short-tags –enable-zend-multibyte –enable-static –with-xsl –with-fpm-user=www –with-fpm-group=www –enable-ftp
6,编译 make && make install
7,创建 php的配置文件 cp /data/php/etc/php-fpm.conf.default /data/php/etc/php-fpm.conf
8,主配置文件 cp php-5.5.38/php.ini-production /data/php/lib/php.ini
9,启动PHP服务 /application/php/sbin/php-fpm
php安装完成