Linux源码安装PHP

2017-07-10 · 🙈Ray · 0条 · 514次

1. 下载

下载地址:http://php.net/

2. 依赖库安装

Python(安装libxml2需要用到)

yum search python | grep python-devel sudo yum install python-devel.x86_64 


libxml2

下载地址:ftp://xmlsoft.org/libxml2/

进入解压后的根目录,依次执行下面的命令:

./configuration make make install

libjpeg

yum install libjpeg-devel

freetype

yum install freetype-devel 

libmcrypt

下载地址ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/libmcrypt

进入解压后的根目录,依次执行下面的命令:

./configuration make make install 

libpng

下载地址:http://www.libpng.org/pub/png/libpng.html

./configuration make make install

3. 配置

./configure --prefix=/usr/local/php7.1.1 --with-config-file-path=/usr/local/php7.1.1/etc --enable-fpm --with-fpm-user=ray 
--with-fpm-group=ray --with-apxs2=/usr/local/apache2.4.17/bin/apxs --with-mysql=/usr/local/mysql5.5.47/ --with-mysqli=/usr/local/mysql5.5.47/bin/mysql_config 
--with-openssl=/usr/local/openssl/ --with-zlib --with-gd --with-jpeg-dir --with-png-dir --with-zlib-dir --with-freetype-dir --with-gettext --with-mcrypt 
--enable-ftp --enable-sockets --enable-soap --enable-mbstring=all --with-pdo-mysql=/usr/local/mysql5.5.47/ --enable-fileinfo 

4.安装

make make test make install


  1