1 环境准备
yum install gcc bison bison-devel zlib-devel libmcrypt-devel mcrypt mhash-devel openssl-devel libxml2-devel libcurl-devel bzip2-devel readline-devel libedit-devel sqlite-devel jemalloc jemalloc-devel
yum install libpng
yum install libpng-devel
yum -y install libjpeg-devel
yum install freetype-devel
cd /usr/local/src
wget http://cn2.php.net/distributions/php-5.6.30.tar.gz
tar zvxf php-5.6.30.tar.gz
cd php-5.6.30
groupadd www
useradd -g www -s /sbin/nologin www
2 编译安装 (##编译参数)
./configure --prefix=/usr/local/php \
--with-apxs2=/usr/local/apache/bin/apxs \
--with-config-file-path=/usr/local/php/etc \
--enable-inline-optimization --disable-debug \
--disable-rpath --enable-shared --enable-opcache \
--enable-fpm --with-fpm-user=www \
--with-png-dir \
--with-freetype-dir \
--with-jpeg-dir \
--with-gd \
--with-fpm-group=www \
--with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-gettext \
--enable-mbstring \
--with-iconv \
--with-mcrypt \
--with-mhash \
--with-openssl \
--enable-bcmath \
--enable-soap \
--with-libxml-dir=/usr/ \
--enable-pcntl \
--enable-shmop \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--enable-sockets \
--with-curl --with-zlib \
--enable-zip \
--with-bz2 \
--with-readline
3. 编译安装
make && make install
如下图 ,不抱任何错误
4.配置服务
配置文件