编译安装hph
一、安装相关的依赖:
yum -y install gcc gcc-c++ bzip2-devel libjpeg-devel libpng-devel freetype-devel libxml2-devel
二、解压php安装包php-5.6.29.tar.gz
tar -xzvf php-5.6.29.tar.gz
三、编译安装php
cd /home/oldboy/tools/php-5.6.29./configure \
--prefix=/application/php-5.6.29 \
--with-mysql=/application/mysql \
--with-iconv-dir=/usr/local/libiconv \
--with-freetype-dir \
--with-jpeg-dir \
--with-zlib \
--disable-rpath \
--enable-safe-mode \
--enable-bcmath \
--enable-shmop \
--enable-sysvsem \
--enable-inline-optimization \
--with-curl \
--with-curlwrappers \
--enable-fpm \
--enable-mbstring \
--with-mcrypt \
--with-gd \
--enable--gd-native-ttf \
--with-openssl \
--with-mhash \
--enable-sockets \
--with-xmlrpc \
--enable-zip \
--enable-soap \
--enable-short-tags \
--enable-zend-multibyte \
--enable-static \
--with-xsl \
--with-fpm-user=nginx \
--with-fpm-group=nginx \
--enable-ftp
报错处理:
configure: error: Don’t know how to define struct flock on this system, set –enable-opcache=no
echo /application/mysql/lib >> /etc/ld.so.conf.d/mysql-x86_64.conf ldconfig -vconfigure: error: off_t undefined; check your library configuration此错误是由于以下的问题引起的重启安装libxslt,或者指定libxslt目录所在的位置为题解决。。--with-xsl=DIR Include XSL support. DIR is the libxslt base
install directory(libxslt >= 1.1.0 required)
ll /usr/local/httpd/modules/ | grep --color php
五、复制php的配置文件
cp /usr/src/php-5.6.22/php.ini-production /usr/local/php5.6/etc/php.ini