Linux CentOS编译安装PHP

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 libXpm-devel libjpeg-devel freetype-devel libpng-devel

2.切换到下载解压好的php目录下开始,编译安装:

./configure --prefix=/你想存放的PHP目录/ \
--with-apxs2=/你的apache目录/bin/apxs \
--with-config-file-path=/你的PHP目录/etc/ \
--with-config-file-scan-dir=/usr/local/etc/ \
--with-zlib \
--with-curl \
--enable-bcmath \
--with-jpeg-dir=/usr/local/jpeg \
--with-png-dir \
--with-xpm-dir \
--with-freetype-dir \
--with-gd  \
--with-mhash \
--enable-mbstring \
--with-mcrypt  \
--with-libxml-dir \
--with-iconv-dir \
--with-pcre-dir \
--with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-fpm-user=www \
--with-fpm-group=www \
--with-openssl \
--enable-zip \
--enable-inline-optimization \
--disable-debug \
--enable-shared \
--enable-opcache \
--enable-fpm \
--with-gettext \
--enable-soap \
--enable-pcntl \
--enable-shmop \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--enable-sockets \
--with-bz2 \
--with-readline

 3.make -j8   -->   make install

4.修改配置文件:注意是切到解压出来的php目录进行操作
cp php.ini-development /你刚才编译安装指定的PHP目录/etc/php.ini

除特别注明外,本站所有文章均为原创,转载请注明原文链接:https://www.myblogbo.com/article/19.html

 Top