2012-02-03

LINUX - 增加 php 的 configure 的參數

若碰到以 tar ball 安裝好的 php 需要補增參數時, 做法如下
以增加 --enable-pcntl 為例

  • step 1 - 取得之前 configure 的設定; 這裡有幾個做法 :
  • 寫一隻內容為 <?phpinfo();?> 的 php 在網頁上看 
  • 或直接在 server 執行 /home/php/bin/php -i | grep Configure, 這跟上行其實是一樣的, 只是不必開啟 web server 也可以看
  •  不然若之前安裝時的 src 目錄還在, 裡面會有一個 configure.nice, 就是上次編繹好的參數, 把它拿來用
  • step 2 - 執行 configure 
  • './configure'  '--prefix=/home/php' '--enable-discard-path' '--enable-fastcgi' '--enable-force-cgi-redirect' '--with-oci8=instantclient,/home/oracle' '--enable-pdo' '--with-pdo-oci=instantclient,/home/oracle,10.1.0.0' '--with-libdir=lib64' '--with-jpeg-dir=/usr/lib64' '--with-png-dir=/usr/lib64' '--with-gd' '--with-curl' '--with-zlib' '--with-pcre-regex' '--with-iconv' '--with-libxml-dir=/usr/lib64' '--without-pear' '--enable-dom' '--enable-session' '--enable-exif' '--enable-xml' '--enable-libxml' '--enable-ctype' '--enable-shmop' '--enable-spl' '--enable-mbstring' '--enable-json' '--enable-simplexml' '--enable-pcntl' '--without-mysql' '--with-freetype-dir=/usr' '--enable-bcmath'
    
  • step 3 - 依序執行 make; make install;
  • step 4 - restart web server




沒有留言:

張貼留言