LNMP-源碼 PHP7

來源:互聯網
上載者:User

標籤:lnmp源碼 php7

php7

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

本文出自 “logs” 部落格,請務必保留此出處http://51log.blog.51cto.com/6076767/1832134

LNMP-源碼 PHP7

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.