php編譯安裝以及遇到的問題

2021-08-08 07:26:00 字數 3462 閱讀 8185

關於linux安裝php編譯的一些問題解決,原作者部落格很好:

安裝完mysql以及一些擴充套件庫後,方可開始安裝php。

安裝php依賴庫 寫道

yum install -y gcc gcc-c++ make zlib zlib-devel pcre pcre-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers

安裝php時我用如下引數成功執行,執行後,用make zend_extra_libs='-liconv'

php編譯引數選項 寫道

php_install_path=/data/web/php

mysql_install_path=/data/web/mysql

如果加的引數有不支援的,提示比如:configure: warning: unrecognized options: --enable-discard-path, --enable-safe-mode, --enable-fastcgi, --enable-force-cgi-redirect

說明上述這些引數廢棄了

具體引數含義可以用./configure --help來檢視。

列表如下(部分引數未得到解釋):

# 指定 php 安裝目錄

--prefix=/usr/local/php 

# 指定php.ini位置

--with-config-file-path=/usr/local/php/etc 

# mysql安裝目錄,對mysql的支援

--with-mysql=/usr/local/mysql

mysqli擴充套件技術不僅可以呼叫mysql的儲存過程、處理mysql事務,而且還可以使訪問資料庫工作變得更加穩定。

--with-mysqli=/usr/local/mysql/bin/mysql_config   

整合 apache,apxs功能是使用mod_so中的loadmodule指令,載入指定模組到 apache,要求 apache 要開啟so模組

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

# 選項指令 --with-iconv-dir 用於 php 編譯時指定 iconv 在系統裡的路徑,否則會掃瞄預設路徑。

--with-iconv-dir=/usr/local 

--with-freetype-dir   開啟對freetype字型庫的支援 

--with-jpeg-dir   開啟對jpeg的支援 

--with-png-dir   開啟對png的支援 

--with-zlib-dir   開啟zlib庫的支援,用於http壓縮傳輸

--with-libxml-dir   開啟libxml2庫的支援

--disable-rpath    關閉額外的執行庫檔案 

--enable-bcmath    開啟大小調整,用到zabbix監控的時候用到了這個模組

--enable-shmop --enable-sysvsem  這樣就使得你的php系統可以處理相關的ipc函式了。

--enable-inline-optimization  優化執行緒

--with-curl    開啟curl瀏覽工具的支援 

--enable-mbregex

--enable-fpm 打上php-fpm 補丁後才有這個引數,cgi方式安裝的啟動程式

--enable-mbstring    多位元組,字串的支援 

--with-mcrypt                    mcrypt演算法擴充套件

--with-mhash                     mhash演算法擴充套件

--with-gd    開啟gd庫的支援 

--enable-gd-native-ttf   支援truetype字串函式庫

--with-openssl      openssl的支援,加密傳輸https時用到的

--enable-pcntl   freetds需要用到的,可能是鏈結mssql 才用到

--enable-sockets     開啟 sockets 支援

--with-xmlrpc    開啟xml-rpc的c語言 

--enable-zip   開啟對zip的支援 

--enable-ftp   開啟ftp的支援 

--with-bz2    開啟對bz2檔案的支援        

--without-iconv   關閉iconv函式,字符集間的轉換 

--with-ttf     開啟freetype1.*的支援,可以不加了 

--with-xsl     開啟xslt 檔案支援,擴充套件了libxml2庫 ,需要libxslt軟體 

--with-gettext     開啟gnu 的gettext 支援,編碼庫用到 

--with-pear    開啟pear命令的支援,php擴充套件用的 

--enable-calendar    開啟日曆擴充套件功能

--enable-exif    的元資料支援 

--enable-magic-quotes    魔術引用的支援 

--disable-debug    關閉除錯模式 

--with-mime-magic=/usr/share/file/magic.mime      魔術標頭檔案位置

cgi方式安裝才用的引數

--enable-fastcgi            支援fastcgi方式啟動php

--enable-force-cgi-redirect        重定向方式啟動php

--with-ncurses         支援ncurses 螢幕繪製以及基於文字終端的圖形互動功能的動態庫

--with-gmp  應該是支援一種規範

--enable-dbase                     建立dba 作為共享模組

--with-pcre-dir=/usr/local/bin/pcre-config      perl的正則庫案安裝位置

--disable-dmalloc

--with-gdbm                     dba的gdbm支援

--enable-sigchild

--enable-sysvshm

--enable-zend-multibyte         支援zend的多位元組

--enable-wddx

--enable-soap

編譯安裝PHP遇到的問題

今天公升級了伺服器的mysql到5.5,是通過rpm安裝,公升級之後發現專案中php報錯,於是打算將php也公升級下。configure prefix usr local php with config file path usr local php etc with mysql usr with ...

PHP編譯遇到的問題

編譯php的時候遇到的問題 編譯 報錯資訊 configure error please reinstall the libcurl distribution easy.h should be in include curl 解決辦法 yum install curl devel 再次編譯報錯 co...

PHP編譯遇到的問題

編譯php的時候遇到的問題 編譯 報錯資訊 configure error please reinstall the libcurl distribution easy.h should be in include curl 解決辦法 yum install curl devel 再次編譯報錯 co...