php5.6源碼安裝

首先下載php-5.6.39安裝包

http://www.php.net/downloads.php

先通過yum安裝部分插件,否則configure時會報錯,可以先configure,根據報錯內容yum對應,其中mcrypt無法yum安裝

 

  yum install  -y libcurl    libvpx-devel   libjpeg-devel   libpng-devel   openssl
  openssl-devel  gmp-devel  libmcrypy  readline  readline-devel   libxslt
  libxslt-devel   freetype   freetype-devel

解壓tar包,並進入

./configure \
--prefix=/png/php/7.0.0 \
--enable-opcache \
--enable-fpm \
--enable-pdo \
--enable-sockets \
--enable-exif \
--enable-soap \
--enable-ftp \
--enable-wddx \
--enable-pcntl \
--enable-soap \
--enable-bcmath \
--enable-mbstring \
--enable-dba \
--enable-gd-native-ttf \
--enable-gd-jis-conv \
--enable-zip \
--enable-calendar \
--enable-shmop \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--with-mysqli \
--with-pdo-mysql \
--with-pdo-sqlite \
--with-iconv \
--with-gmp \
--with-pspell \
--with-xmlrpc \
--with-openssl \
--with-mhash \
--with-mcrypt \
--with-xsl \
--with-curl \
--with-pcre-regex \
--with-gd \
--with-jpeg-dir=/usr \
--with-png-dir=/usr \
--with-zlib-dir=/usr \
--with-xpm-dir=/usr \
--with-freetype-dir=/usr \
--with-gettext=/usr \
--with-zlib=/usr \
--with-bz2=/usr \
--with-recode=/usr \
--with-ldap \
--with-pear \
--with-readline \
--with-apxs2=/usr/sbin/apxs       

--enable表示不需要第三方庫直接啓用,--with表示要使用第三方擴展庫

--with-apxs2=/usr/sbin/apxs       用於生成libphp5.so模塊,在httpd中引入該模塊,才能訪問php

 

成功之後再make  && make install

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章