CentOS5 64位系統Apache 2.2 + PHP 5.3編譯安裝

來源:互聯網
上載者:User

本來測試機器上裝的是Nginx-0.8.54,奇怪的是,Magento管理背景【產品類別管理】和【產品管理】兩個功能都不能用,猜測應該是Ajax請求的Rewrite沒有在nginx.conf中設定正確,導致請求不到資料。由於項目比較急,沒有時間去折騰,就換成了Apache 2.2.17了,編譯安裝比較簡單,如下:

 代碼如下 複製代碼

./configure --prefix=/usr/local/apache --enable-rewrite

PHP5.3.6編譯相對比較複雜:

 代碼如下 複製代碼

./configure --prefix=/usr/local/php
            --with-apxs2=/usr/local/apache/bin/apxs
            --with-mysql=mysqlnd
            --with-mysqli=mysqlnd
            --with-pdo-mysql=mysqlnd
            --without-pdo-sqlite
            --without-sqlite3
            --without-sqlite
            --with-mysql-sock=/tmp/mysql.sock
            --with-curl
            --enable-mbstring
            --with-mhash
            --with-mcrypt
            --with-openssl
            --with-libdir=lib64
            --enable-gd-native-ttf
            --with-jpeg-dir
            --with-png-dir
            --with-gd
            --with-zlib
            --with-freetype-dir
            --enable-sockets
            --with-gettext
            --enable-zip
            --enable-soap
            --with-xmlrpc

需要注意的是:CentoOS-64bit下編譯,要加上 --with-libdir=lib64,否則可能導致莫名其妙的錯誤。

PHP5.3中原始碼中內建了訪問MySQL的驅動,這樣編譯起來就很簡單了,不用像以前一樣需要指明mysql的安裝路徑了。

 代碼如下 複製代碼

--with-mysql=mysqlnd
--with-mysqli=mysqlnd
--with-pdo-mysql=mysqlnd

PHP5.3編譯為Apache中的一個模組(mod_php),故需要--with-apxs2選項。

 代碼如下 複製代碼

--with-apxs2=/usr/local/apache/bin/apxs


每個選項後面的 "",不能有空格。

聯繫我們

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