編譯安裝php-5.4.29

來源:互聯網
上載者:User
PHP的安裝依賴Mysql環境,在安裝前需要先檢查mysql是否安裝

一.環境

系統:CentOS 6.4x64 迷你安裝

IP:192.168.3.54


二、安裝

安裝前檢查系統內容

[root@rsync-3 ~]# netstat -anpt |egrep '3306|80'tcp        0      0 0.0.0.0:3306                0.0.0.0:*                   LISTEN      1609/mysqld         tcp        0      0 :::80                       :::*                        LISTEN      1739/httpd [root@rsync-3 ~]# /usr/local/apache/bin/apachectl -vServer version: Apache/2.4.12 (Unix)Server built:   May  5 2015 15:44:15[root@rsync-3 ~]# mysql -u root -plyao36843 -h 127.0.0.1 -e 'select version();'+------------+| version()  |+------------+| 5.5.37-log |+------------+

安裝PHP所需的基礎庫檔案

yum install -y zlib libxml libjpeg freetype libpng gd curl libiconv zlib-devel libxml2-devel libjpeg-devel freetype-devel libpng-devel gd-devel curl-devel libxslt-devel

源碼安裝libiconv

[root@rsync-3 ~]# wget [root@rsync-3 ~]# tar xf libiconv-1.14.tar.gz [root@rsync-3 ~]# cd libiconv-1.14[root@rsync-3 libiconv-1.14]# ./configure  --prefix=/usr/local/libiconv [root@rsync-3 libiconv-1.14]# make && make install

安裝PHP

[root@rsync-3 ~]# tar xf php-5.4.29.tar.gz[root@rsync-3 ~]# cd php-5.4.29[root@rsync-3 php-5.4.29]# ./configure \> --prefix=/usr/local/php-5.4.39 \> --with-apxs=/usr/local/apache/bin/apxs \> --with-mysql=/usr/local/mysql \> --with-xmlrpc \> --with-openssl \> --with-zlib \> --with-freetype-dir \> --with-gd \> --with-jpeg-dir \> --with-png-dir \> --with-iconv=/usr/local/libiconv \> --enable-short-tags \> --enable-sockets \> --enable-zend-multibyte \     #該參數已被廢棄> --enable-soap \> --enable-mbstring \> --enable-static \> --enable-gd-native-ttf \> --with-curl \> --with-xsl \> --enable-ftp \> --with-libxml-dir#開始編譯檔案configure: WARNING: unrecognized options: --enable-zend-multibytechecking for grep that handles long lines and -e... /bin/grepchecking for egrep... /bin/grep -Echecking for a sed that does not truncate output... /bin/sedchecking build system type... x86_64-unknown-linux-gnuchecking host system type... x86_64-unknown-linux-gnuchecking target system type... x86_64-unknown-linux-gnuchecking for cc... ccchecking whether the C compiler works... yeschecking for C compiler default output file name... a.outchecking for suffix of executables... checking whether we are cross compiling... nochecking for suffix of object files... ochecking whether we are using the GNU C compiler... yeschecking whether cc accepts -g... yeschecking for cc option to accept ISO C89... none neededchecking how to run the C preprocessor... cc -Echecking for icc... nochecking for suncc... nochecking whether cc understands -c and -o together... yeschecking how to run the C preprocessor... cc -Echecking for ANSI C header files... yeschecking for sys/types.h... yeschecking for sys/stat.h... yeschecking for stdlib.h... yeschecking for string.h... yeschecking for memory.h... yeschecking for strings.h... yeschecking for inttypes.h... yeschecking for stdint.h... yeschecking for unistd.h... yeschecking minix/config.h usability... nochecking minix/config.h presence... nochecking for minix/config.h... nochecking whether it is safe to define __EXTENSIONS__... yeschecking whether ln -s works... yeschecking for system library directory... libchecking whether to enable runpaths... yeschecking if compiler supports -R... nochecking if compiler supports -Wl,-rpath,... yeschecking for gawk... gawkchecking for bison... nochecking for byacc... nochecking for bison version... invalidconfigure: WARNING: bison versions supported for regeneration of the Zend/PHP parsers: 1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1 2.4.2 2.4.3 2.5 2.5.1 2.6 2.6.1 2.6.2 2.6.4 (found: none).checking for re2c... noconfigure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.checking whether to enable computed goto gcc extension with re2c... nochecking whether to force non-PIC code in shared modules... nochecking whether /dev/urandom exists... yeschecking for pthreads_cflags... -pthreadchecking for pthreads_lib... Configuring SAPI moduleschecking for AOLserver support... nochecking for Apache 1.x module support via DSO through APXS... configure: error: You have enabled Apache 1.3 support while your server is Apache 2.  Please use the appropriate switch --with-apxs2#這裡提示我們使用--with-apxs2參數#修改參數重新編譯[root@rsync-3 php-5.4.29]# ./configure \> --prefix=/usr/local/php-5.4.39 \> --with-apxs2=/usr/local/apache/bin/apxs \     #這雷根據提示使用--with-apxs2> --with-mysql=/usr/local/mysql \> --with-xmlrpc \> --with-openssl \> --with-zlib \> --with-freetype-dir \> --with-gd \> --with-jpeg-dir \> --with-png-dir \> --with-iconv=/usr/local/libiconv \> --enable-short-tags \> --enable-sockets \> --enable-zend-multibyte \   #該參數已被廢棄,刪除後重新編譯> --enable-soap \> --enable-mbstring \> --enable-static \> --enable-gd-native-ttf \> --with-curl \> --with-xsl \> --enable-ftp \> --with-libxml-dir[root@rsync-3 php-5.4.29]# make && make install[root@rsync-3 php-5.4.29]# ln -s /usr/local/php-5.4.39 /usr/local/php[root@rsync-3 php-5.4.29]# cp php.ini-production /usr/local/php/lib/php.ini
  • 聯繫我們

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