centos 6.6 編譯安裝PHP7.0.5____PHP

來源:互聯網
上載者:User
PHP7.0正式版也出來了,今天編譯安裝了一下,寫下安裝步驟,我是在centos6.6 環境中編譯的,如下:

下載地址http://cn2.php.net/distributions/php-7.0.5.tar.gz 安裝編譯所需的包,如遇見部分包找不到 請先執行

yum  install epel-release  //擴充封裝更新包yum  update //更新yum源
然後在執行如下命令
yum install -y gcc gcc-c++  make zlib zlib-devel pcre pcre-devel  libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers  libmcrypt libmcrypt-devel  libXpm-devel
make & make install 執行編譯命令
./configure --prefix=/usr/local/php --enable-fpm  --with-mcrypt=/usr/local/libmcrypt --with-zlib --enable-mbstring --enable-pcntl --with-openssl  --enable-soap  --with-pear   --with-png-dir    --with-pcre-regex   --enable-mysqlnd  \--with-mysqli=mysqlnd \--with-pdo-mysql=mysqlnd \--with-mysql-sock=/var/lib/mysql/mysql.sock  --with-gd --with-jpeg-dir=/usr/lib --enable-gd-native-ttf   --with-gettext --with-curl  --enable-sockets --enable-bcmath --enable-xml --with-bz2 --enable-zip --with-freetype-dir=/usr/include/freetype2/ 

上述命令中需要注意的是   --with-mysqli 參數 指定的是 mysql所在的bin 檔案路徑如: /usr/bin/mysql_config 
 --with-freetype-dir 指定的路徑 是 /usr/include/freetype2/  如果你是yum 安裝的 freetype2 的話
其他的根據你自己實際需要增刪即可
設定檔
#  cp php.ini-development /usr/local/php/lib/php.ini #  cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
#  cp /usr/local/php/etc/php-fpm.d/www.conf.default /usr/local/php/etc/php-fpm.d/www.conf #  cp -R ./sapi/fpm/php-fpm /etc/init.d/php-fpm
需要注意的是php7中www.conf這個設定檔配置phpfpm的連接埠號碼等資訊,如果你修改預設的9000連接埠號碼需在這裡改,再改nginx的配置 啟動 #  /etc/init.d/php-fpm


同學們可以訪問這位同學的博文獲得更多的詳情 http://blog.csdn.net/21aspnet/article/details/47708763

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.