./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql --with-mysqli=/usr/bin/mysql_config --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi --enable-fpm --enable-force-cgi-redirect --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-ldap --with-ldap-sasl --with-xmlrpc --enable-zip --enable-soap --without-pear --with-zlib --enable-pdo --with-pdo-mysql --with-mysql--prefix=/usr/local/php //指定 php 安裝目錄
--with-apxs2=/usr/local/apache/bin/apxs //整合apache,apxs功能是使用mod_so中的LoadModule指令,加載指定模塊到 apache,要求 apache 要打開SO模塊
--with-config-file-path=/usr/local/php/etc //指定php.ini位置
--with-MySQL=/usr/local/mysql //mysql安裝目錄,對mysql的支持
--with-mysqli=/usr/local/mysql/bin/mysql_config //mysqli擴展技術不只能夠調用MySQL的存儲過程、處理MySQL事務,並且還可使訪問數據庫工做變得更加穩定。
--enable-safe-mode 打開安全模式
--enable-ftp 打開ftp的支持
--enable-zip 打開對zip的支持
--with-bz2 打開對bz2文件的支持
--with-jpeg-dir 打開對jpeg圖片的支持
--with-png-dir 打開對png圖片的支持
--with-freetype-dir 打開對freetype字體庫的支持
--without-iconv 關閉iconv函數,各類字符集間的轉換
--with-libXML-dir 打開libxml2庫的支持
--with-XMLrpc 打開xml-rpc的c語言
--with-zlib-dir 打開zlib庫的支持
--with-gd 打開gd庫的支持
--enable-gd-native-ttf 支持TrueType字符串函數庫
--with-curl 打開curl瀏覽工具的支持
--with-curlwrappers 運用curl工具打開url流
--with-ttf 打開freetype1.*的支持,能夠不加了
--with-xsl 打開XSLT 文件支持,擴展了libXML2庫 ,須要libxslt軟件
--with-gettext 打開gnu 的gettext 支持,編碼庫用到
--with-pear 打開pear命令的支持,PHP擴展用的
--enable-calendar 打開日曆擴展功能
--enable-mbstring 多字節,字符串的支持
--enable-bcmath 打開圖片大小調整,用到zabbix監控的時候用到了這個模塊
--enable-sockets 打開 sockets 支持
--enable-exif 圖片的元數據支持
--enable-magic-quotes 魔術引用的支持
--disable-rpath 關閉額外的運行庫文件
--disable-debug 關閉調試模式
--with-mime-magic=/usr/share/file/magic.mime 魔術頭文件位置CGI方式安裝才用的參數:--enable-fpm //打上PHP-fpm 補丁後纔有這個參數,CGI方式安裝的啓動程序
--enable-fastCGI //支持fastcgi方式啓動PHP
--enable-force-CGI-redirect //重定向方式啓動PHP
--with-ncurses //支持ncurses 屏幕繪製以及基於文本終端的圖形互動功能的動態庫
--enable-pcntl //freeTDS須要用到的,多是連接mssql 纔用到
--with-mcrypt //mcrypt算法的擴展
--with-mhash //mhash算法的擴展
以上函數庫須要安裝
--with-gmp 應該是支持一種規範
--enable-inline-optimization 優化線程
--with-openssl //openssl的支持,加密傳輸時用到的
--enable-dbase //創建DBA 做爲共享模塊
--with-pcre-dir=/usr/local/bin/pcre-config //perl的正則庫案安裝位置
--disable-dmalloc
--with-gdbm //dba的gdbm支持
--enable-sigchild
--enable-sysvsem
--enable-sysvshm
--enable-zend-multibyte //支持zend的多字節
--enable-mbregex
--enable-wddx
--enable-shmop
--enable-soap1>指定了--with-apxs2=/usr/local/apache/bin/apxs之後,就不要再激活--enable-fpm和--enable-fastCGI,apxs是以php module的模式加載PHP的。
2>Mysql在編譯了Mysql開發library之後,能夠不用指定mysql的路徑。
3>PHP編譯存在基礎的依賴的關係,編譯PHP首先須要安裝XML擴展,由於php5核心默認打開了XML的支持,其餘的基礎庫,相應須要:
4>GD -> zlib, Png, Jpg, 若是須要支持其餘,仍須要根據實際狀況編譯擴展庫,ttf庫須要freetype庫的支持。
5>--enable-magic-quotes,是一個極其不推薦的參數,固然,若是你須要PHP爲你作這些底下的工做,實際上他也沒有很完全的解決問題。
6>-with-openssl,須要openssl庫。php