189 8069 5689

LNMP-源码PHP7

php7

创新互联公司-专业网站定制、快速模板网站建设、高性价比凤庆网站开发、企业建站全套包干低至880元,成熟完善的模板库,直接使用。一站式凤庆网站制作公司更省心,省钱,快速模板网站建设找我们,业务覆盖凤庆地区。费用合理售后完善,十载实体公司更值得信赖。

1、安装PHP所需依赖;

# 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

# ./configure --prefix=/opt/php7 \

--with-config-file-path=/opt/php7/etc \

--with-bz2 \

--with-curl \

--enable-ftp \

--enable-sockets \

--disable-ipv6 \

--with-gd \

--with-jpeg-dir=/opt/php7 \

--with-png-dir=/opt/php7 \

--with-freetype-dir=/opt/php7 \

--enable-gd-native-ttf \

--with-iconv-dir=/opt/php7 \

--enable-mbstring \

--enable-calendar \

--with-gettext \

--with-libxml-dir=/opt/php7 \

--with-zlib \

--with-pdo-MySQL=mysqlnd \

--with-mysqli=mysqlnd \

--with-mysql=mysqlnd \

--enable-dom \

--enable-xml \

--enable-fpm \

--enable-bcmath \

--with-libdir=lib64

# make

# make install

# ls 

# ls /etc/

# find / -name php.ini

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

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

启动php-fpm 

# /usr/local/php7/sbin/php-fpm

二;

PHP5.6安装也是一样安装必须得依赖;

# yum install gcc make gd-devel libjpeg-devel libpng-devel libxml2-devel bzip2-devel libcurl-devel -y

# tar -xf hp5.6.23.tar.gz -C /usr/local

# mv php5.6 php5 

# cd php5

# ./configure \

--prefix=/usr/local/php5 \

--with-config-file-path=/usr/local/php5/etc \

--enable-inline-optimization \

--disable-debug \

--disable-rpath \

--enable-shared \

--enable-opcache \

--enable-fpm \

--with-mysql=mysqlnd \

--with-mysqli=mysqlnd \

--with-pdo-mysql=mysqlnd \

--with-gettext \

--enable-mbstring \

--with-iconv \

--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 \

# make

# make install

# ls 

# ls /etc/

2、找到配置文件更改配置文件;

# find / -name php.ini

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

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

3、启动php-fpm 

# /usr/local/php5/sbin/php-fpm

4、添加PHP命令到环境变量;

# vi .bash_profile

PATH=$PATH:$HOME/bin

    改为:

PATH=$PATH:$HOME/bin:/usr/local/php56/bin

# . .bash_profile

# . .bash_profile

5、查看PHP版本

# php -v

PHP 5.6.23 (cli) (built: Jun 26 2016 00:24:15) 

Copyright (c) 1997-2016 The PHP Group

Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies


分享标题:LNMP-源码PHP7
文章出自:http://cdxtjz.com/article/iieppi.html

其他资讯