Mac 下編譯安裝 php-5.6

1.安裝 PHP

1.1 下載源碼包

http://php.net/get/php-5.6.35.tar.bz2/from/a/mirrorphp

 

1.2 編譯&安裝

./configure --prefix=/usr/local/php-5.6.35 --with-config-file-path=/usr/local/php-5.6.35/etc --with-bz2 --with-curl --enable-ftp \
--enable-sockets --disable-ipv6 --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --enable-gd-native-ttf --with-iconv-dir \
--enable-mbstring --enable-calendar --with-gettext --with-libxml-dir --with-zlib --with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd \
--with-mysql=mysqlnd --enable-dom --enable-xml --enable-fpm 
make & make install

 

1.3 出現的錯誤處理

提示錯誤:crun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrunmysql

處理方法 :sql

xcode-select --install

 

提示錯誤:Cannot locate header file libintl.hxcode

處理方法 :dom

brew install gettext
brew link --force gettext
echo 'export PATH="/usr/local/opt/gettext/bin:$PATH"' >> ~/.zshrc

編輯 configure 文件,將 curl

for i in $PHP_GETTEXT /usr/local /usr; do

修改成:socket

for i in $PHP_GETTEXT /usr/local /usr /usr/local/opt/gettext; do

 

提示錯誤:Please reinstall the iconv libraryurl

處理方法 :spa

wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.15.tar.gz
tar xvzf libiconv-1.15.tar.gz
./configure 
make && make install
相關文章
相關標籤/搜索