Centos7部署php5.6.25

   日期:2020-10-17     浏览:139    评论:0    
核心提示:1、安装php相关依赖包yum install -y 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-devel2、添加组和用户添加组groupadd www#添加php.

1、安装php相关依赖包

yum install -y 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 libpng libpng-devel

 

2、添加组和用户

添加组

groupadd www

#添加php-fpm用户

useradd -g www www

3、下载二进制包

wget https://www.php.net/distributions/php-5.6.25.tar.gz

3.1解压

tar zxvf php-5.6.25.tar.gz

cd php-5.6.25

3.2执行##编译参数

./configure --prefix=/usr/local/php --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-fpm-group=www --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-gettext --disable-fileinfo --enable-mbstring --with-iconv --with-mcrypt --with-mhash --with-openssl --enable-bcmath --enable-soap --with-libxml-dir --enable-pcntl --enable-shmop --enable-ftp --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-sockets --with-gd --enable-gd-native-ttf --with-curl --with-zlib --with-xmlrpc --enable-zip --with-bz2 --with-readline --with-freetype-dir --with-png-dir --enable-intl --with-xsl

 

注:编译时会有报错configure: error: Please reinstall readline - I cannot find readline.h

解决:yum -y install readline-devel

yum -y install libxslt libxslt-devel

再次执行编译

或者报如下错误

解决:

yum install perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker perl-ExtUtils-Embed libicu-devel

再编译

安装

make && make install

 

4、配置服务

#配置文件

# cp php.ini-development /usr/local/php/etc/php.ini

#php-fpm 服务

# cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf

# cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm

# chmod +x /etc/init.d/php-fpm

# chkconfig --add php-fpm

# chkconfig php-fpm on

# service php-fpm start

vim /usr/local/php/etc/php-fpm.conf

service php-fpm restart

5、添加环境变量(php命令行模式)

# vim /etc/profile

PATH=$PATH:/usr/local/php/bin

export PATH

# source /etc/profile

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 
打赏
 本文转载自:网络 
所有权利归属于原作者,如文章来源标示错误或侵犯了您的权利请联系微信13520258486
更多>最近资讯中心
更多>最新资讯中心
0相关评论

推荐图文
推荐资讯中心
点击排行
最新信息
新手指南
采购商服务
供应商服务
交易安全
关注我们
手机网站:
新浪微博:
微信关注:

13520258486

周一至周五 9:00-18:00
(其他时间联系在线客服)

24小时在线客服