centos7 編譯php56

來源:互聯網
上載者:User

標籤:

編譯安裝php5.6 centos7環境

步驟:

//下載php5.6wget http://cn2.php.net/distributions/php-5.6.26.tar.bz2//安裝依賴yum install -y gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libpng libpng-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses curl openssl-devel gdbm-devel db4-devel libXpm-devel libX11-devel gd-devel gmp-devel readline-devel libxslt-devel expat-devel xmlrpc-c xmlrpc-c-devel httpd-devel//解壓tar -jxvf php-5.6.26.tar.bz2cd php-5.6.26//編譯./configure --prefix=/usr/local/php --with-apxs2=/usr/bin/apxs --with-mysql=/usr/local/mysql --with-mysql-sock --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-fpm --with-ncurses --enable-soap --with-libxml-dir --with-XMLrpc --with-openssl --with-mcrypt --with-mhash --with-pcre-regex --with-sqlite3 --with-zlib --enable-bcmath --with-iconv --with-bz2 --enable-calendar --with-curl --with-cdb --enable-dom --enable-exif --enable-fileinfo --enable-filter --with-pcre-dir --enable-ftp --with-gd --with-openssl-dir --with-jpeg-dir --with-png-dir --with-zlib-dir  --with-freetype-dir --enable-gd-native-ttf --enable-gd-jis-conv --with-gettext --with-gmp --with-mhash --enable-json --enable-mbstring --disable-mbregex --disable-mbregex-backtrack --with-libmbfl --with-onig --enable-pdo --with-pdo-mysql --with-zlib-dir --with-pdo-sqlite --with-readline --enable-session --enable-shmop --enable-simplexml --enable-sockets --enable-sqlite-utf8 --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-wddx --with-libxml-dir  --with-xsl --enable-zip --enable-mysqlnd-compression-support --with-pear

  

提示: configure: error: xml2-config not found. Please check your libxml2 installation.

yum install libxml2-dev

提示:Cannot find OpenSSL‘s <evp.h>

yum install openssl openssl-devel

提示:configure: error: Please reinstall the BZip2 distribution

yum install bzip2-devel

提示: configure: error: Please reinstall the libcurl distribution -easy.h should be in <curl-dir>/include/curl/

yum install libcurl-devel

提示:If configure fails try --with-vpx-dir=<DIR> configure: error: jpeglib.h not found

yum install libjpeg-devel

提示:configure: error: png.h not found.

yum install libpng-devel

提示:configure: error: freetype-config not found

yum install freetype-devel

提示:configure: error: Unable to locate gmp.h

yum install gmp-devel

提示:configure: error: mcrypt.h not found. Please reinstall libmcrypt.,由於著作權的原因沒有內建mcrypt的包。額外安裝

wget http://www.atomicorp.com/installers/atomicchmod 777 atomic./atomicyum  install  php-mcrypt  libmcrypt  libmcrypt-devel 

提示:configure: error: Cannot find MySQL header files under /usr/local/mysql.
Note that the MySQL client library is not bundled anymore!

yum install mysql-devel然後修改為mysqlnd --with-mysql=mysqlnd  --with-mysqli=mysqlnd
Mysql Native驅動(Mysql Native Driver 簡稱:mysqlnd )在PHP5.3.0版本中被引入。PHP5.4之後的版本mysqlnd被作為預設配置選項


修改過後的安裝依賴:
yum install -y gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libpng libpng-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses curl openssl-devel gdbm-devel db4-devel libXpm-devel libX11-devel gd-devel gmp-devel readline-devel libxslt-devel expat-devel xmlrpc-c xmlrpc-c-devel httpd-devel libxml2-dev  openssl openssl-devel bzip2-devel libcurl-devel libjpeg-devel libpng-devel freetype-devel gmp-devel

 mycrypt

wget http://www.atomicorp.com/installers/atomicchmod 777 atomic./atomicyum  install  php-mcrypt  libmcrypt  libmcrypt-devel 

編譯選項:

./configure --prefix=/usr/local/php --with-apxs2=/usr/bin/apxs --with-mysql=mysqlnd --with-mysql-sock --with-mysqli=mysqlnd --enable-fpm --with-ncurses --enable-soap --with-libxml-dir --with-XMLrpc --with-openssl --with-mcrypt --with-mhash --with-pcre-regex --with-sqlite3 --with-zlib --enable-bcmath --with-iconv --with-bz2 --enable-calendar --with-curl --with-cdb --enable-dom --enable-exif --enable-fileinfo --enable-filter --with-pcre-dir --enable-ftp --with-gd --with-openssl-dir --with-jpeg-dir --with-png-dir --with-zlib-dir  --with-freetype-dir --enable-gd-native-ttf --enable-gd-jis-conv --with-gettext --with-gmp --with-mhash --enable-json --enable-mbstring --disable-mbregex --disable-mbregex-backtrack --with-libmbfl --with-onig --enable-pdo --with-pdo-mysql --with-zlib-dir --with-pdo-sqlite --with-readline --enable-session --enable-shmop --enable-simplexml --enable-sockets --enable-sqlite-utf8 --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-wddx   --with-xsl --enable-zip --enable-mysqlnd-compression-support --with-pear

  

centos7 編譯php56

相關文章

聯繫我們

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