linux部署php5.6

1、依赖库安装

#yum -y install libxml2 libxml2-devel bzip2 bzip2-devel curl curl-devel wget make readline-devel

2、下载、编译、安装

#mkdir /home/setup #创建下载路径 已创建跳下一步 
#cd /home/setup #切换路径
#wget ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/libmcrypt/libmcrypt-2.5.7.tar.gz #下载
#tar -zxvf libmcrypt-2.5.7 #解压
#cd libmcrypt-2.5.7 #切换
#./configure --prefix=/usr/local #编译
#make && make install #安装

3、部署php

#cd /home/setup #切换
#wget http://cn2.php.net/distributions/php-5.6.34.tar.gz #下载
#tar zxvf php-5.6.34.tar.gz #解压缩
#cd php-5.6.34 #切换
#export LD_LIBRARY_PATH=/lib/:/usr/lib/:/usr/local/lib #共享库位置
#./configure --prefix=/usr/local/php56 --with-config-file-path=/usr/local/php56/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 --enable-mbstring --with-iconv --with-mcrypt --with-mhash --with-openssl --enable-bcmath --enable-soap --with-libxml-dir --enable-pcntl --enable-shmop --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-sockets --with-curl --with-zlib --enable-zip --with-bz2 --with-readline --without-gd  --with-libdir=lib64 #配置
#make && make install #编译安装

4、查看版本

#cd /usr/local/php56/bin/
#./php -version

5、配置php

#cd /home/setup/php-5.6.34
#cp php.ini-development /usr/local/php56/etc/php.ini

6、配置php-fpm 服务

#cp /usr/local/php56/etc/php-fpm.conf.default /usr/local/php56/etc/php-fpm.conf
#cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm56
#chmod +x /etc/init.d/php-fpm56

7、php启动

#service php-fpm56 start #centos6启动方式
#systemctl start php-fpm56  #centos7启动方式
下方把php加入开机启动
#chkconfig php-fpm56 on 
关闭php则需要通过杀进程方式进行
#ps aux|grep php-fpm | xargs kill -9 杀进程
####################### 安装完成路径

Installing shared extensions: /usr/local/php56/lib/php/extensions/no-debug-non-zts-20131226/
Installing PHP CLI binary: /usr/local/php56/bin/
Installing PHP CLI man page: /usr/local/php56/php/man/man1/
Installing PHP FPM binary: /usr/local/php56/sbin/
Installing PHP FPM config: /usr/local/php56/etc/
Installing PHP FPM man page: /usr/local/php56/php/man/man8/
Installing PHP FPM status page: /usr/local/php56/php/php/fpm/
Installing PHP CGI binary: /usr/local/php56/bin/
Installing PHP CGI man page: /usr/local/php56/php/man/man1/
Installing build environment: /usr/local/php56/lib/php/build/
Installing header files: /usr/local/php56/include/php/
Installing helper programs: /usr/local/php56/bin/
program: phpize
program: php-config
Installing man pages: /usr/local/php56/php/man/man1/
page: phpize.1
page: php-config.1
Installing PEAR environment: /usr/local/php56/lib/php/

#

猜你喜欢

转载自blog.csdn.net/weixin_36914964/article/details/81776890