這篇文章主要介紹mac安裝PHP7時出現(xiàn)的問題有哪些,文中介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們一定要看完!
創(chuàng)新互聯(lián)公司服務(wù)項目包括蘆山網(wǎng)站建設(shè)、蘆山網(wǎng)站制作、蘆山網(wǎng)頁制作以及蘆山網(wǎng)絡(luò)營銷策劃等。多年來,我們專注于互聯(lián)網(wǎng)行業(yè),利用自身積累的技術(shù)優(yōu)勢、行業(yè)經(jīng)驗、深度合作伙伴關(guān)系等,向廣大中小型企業(yè)、政府機構(gòu)等提供互聯(lián)網(wǎng)行業(yè)的解決方案,蘆山網(wǎng)站推廣取得了明顯的社會效益與經(jīng)濟效益。目前,我們服務(wù)的客戶以成都為中心已經(jīng)輻射到蘆山省份的部分城市,未來相信會繼續(xù)擴大服務(wù)區(qū)域并繼續(xù)獲得客戶的支持與信任!
背景
前幾天在mac上跑workrman,由于workerman需要開啟多個進程,多進程需要pcntl擴展的支持,我之前那個brew安裝的php71沒有這個擴展,就直接卸載了php71,然后想下載源碼編譯安裝php7的更高版本,也可以更自由的安裝擴展。
源碼編譯安裝(php-7.2.7)
問題一
configure: WARNING: you should use --build, --host, --target configure: WARNING: invalid host type: configure: WARNING: you should use --build, --host, --target configure: WARNING: invalid host type: --enable-fpm configure: WARNING: you should use --build, --host, --target configure: WARNING: invalid host type: --with-MySQLi configure: WARNING: you should use --build, --host, --target configure: WARNING: invalid host type: --with-pdo-mysql configure: WARNING: you should use --build, --host, --target configure: WARNING: invalid host type: --with-iconv-dir configure: WARNING: you should use --build, --host, --target configure: WARNING: invalid host type: --with-eeeetype-dir configure: WARNING: you should use --build, --host, --target configure: WARNING: invalid host type: --with-zlib configure: WARNING: you should use --build, --host, --target configure: WARNING: invalid host type: --with-jpeg-dir configure: WARNING: you should use --build, --host, --target configure: WARNING: invalid host type: --with-png-dir configure: error: invalid variable name: ` --with-libxml-dir'
解決:都是因為—with前面多了個空格
問題二
Sorry, I cannot run apxs. Possible reasons follow: 1. Perl is not installed 2. apxs was not found. Try to pass the path using --with-apxs2=/path/to/apxs 3. Apache was not built using --enable-so (the apxs usage page is displayed)
解決辦法
brew install httpd find / -name apxs Centos下執(zhí)行 yum install -y httpd-devel
查找到apxs文件路徑,然后修改編譯參數(shù)如下
--with-apxs2=/usr/local/bin/apxs
問題三
checking if the location of ZLIB install directory is defined... no ; configure: error: Cannot find libz.
解決辦法
brew install zlib find / -name lib
加上參數(shù)
--with-zlib-dir=/usr/local/Cellar/zlib/1.2.11
問題四
configure: error: Cannot locate header file libintl.h
原因是沒有g(shù)ettext
解決辦法:
$PHP_GETTEXT /usr/local /usr; do
configure文件改為
for i in $PHP_GETTEXT /usr/local /usr /usr/local/opt/gettext; do
問題五
configure: error: Please specify the install prefix of iconv with --with-iconv=<DIR>
解決辦法,編譯參數(shù)中加上
\--with-iconv=/usr/local/Cellar/libiconv/1.15
問題六
checking for libiconv in -liconv... no checking for iconv in -liconv... no configure: error: Please reinstall the iconv library.
【最終卡在了這里,沒解決。然后編譯安裝就沒有成功】
最后解決到問題五的時候的編譯安裝命令如下:
./configure --prefix=/usr/local/php/7.2.7\—with-config-file-path=/usr/local/php/7.2.7/etc \--with-config-file-scan-dir=/usr/local/php/7.2.7/etc/conf.d \--with-apxs2=/usr/local/bin/apxs \--with-zlib-dir=/usr/local/Cellar/zlib/1.2.11 \--enable-fpm \--with-fpm-user=www \--with-fpm-group=www \--with-mysqli \--with-pdo-mysql \--with-iconv=/usr/local/Cellar/libiconv/1.15 \--with-eeeetype-dir \--with-zlib \--with-jpeg-dir \--with-png-dir \--with-libxml-dir=/usr/bin/xml2-config \--enable-xml \--disable-rpath \--enable-bcmath \--enable-shmop \--enable-sysvsem \--enable-inline-optimization \--with-curl \--enable-mbregex \--enable-mbstring \--with-mcrypt \--enable-ftp \--with-gd \--enable-gd-native-ttf \--with-onsnssl \--with-mhash \--enable-pcntl \--enable-sockets \--with-xmlrpc \--enable-zip \--enable-soap \--without-pear \--with-gettext \--disable-fileinfo \--enable-maintnener-zts \--enable-mysqlnd
brew安裝
1.搜索brew中的php
brew search php
出現(xiàn)了:php@5.6 php@7.1 php@7.0
2.然后安裝了php7.0
brew install php70
3.將php設(shè)置系統(tǒng)環(huán)境變量
find / -name php # 先找到php執(zhí)行文件 cp /usr/local/Cellar/php@7.0/7.0.30_1/bin/php /usr/bin # 將php執(zhí)行文件放到/usr/bin/文件夾中
最后
通過源碼編譯安裝沒有成功,還是brew install安裝成功。
以上是mac安裝PHP7時出現(xiàn)的問題有哪些的所有內(nèi)容,感謝各位的閱讀!希望分享的內(nèi)容對大家有幫助,更多相關(guān)知識,歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道!
網(wǎng)頁題目:mac安裝PHP7時出現(xiàn)的問題有哪些
路徑分享:http://jinyejixie.com/article4/pgisoe.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供服務(wù)器托管、軟件開發(fā)、品牌網(wǎng)站制作、網(wǎng)站導(dǎo)航、做網(wǎng)站、網(wǎng)站制作
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)