摘要:背景前幾天在上跑,由于需要開啟多個進程,多進程需要擴展的支持,我之前那個安裝的沒有這個擴展,就直接卸載了,然后想下載源碼編譯安裝的更高版本,也可以更自由的安裝擴展。
背景
前幾天在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文件路徑,然后修改編譯參數如下
--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
加上參數
--with-zlib-dir=/usr/local/Cellar/zlib/1.2.11
參考鏈接
問題四
configure: error: Cannot locate header file libintl.h 原因是沒有gettext
解決辦法:
$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=
解決辦法,編譯參數中加上
--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-mysqlndbrew安裝
1.搜索brew中的php
brew search php
出現(xiàn)了:[email protected] [email protected] [email protected]
2.然后安裝了php7.0
brew install php70
3.將php設置系統(tǒng)環(huán)境變量
find / -name php # 先找到php執(zhí)行文件 cp /usr/local/Cellar/[email protected]/7.0.30_1/bin/php /usr/bin # 將php執(zhí)行文件放到/usr/bin/文件夾中最后
通過源碼編譯安裝沒有成功,還是brew install安裝成功
文章版權歸作者所有,未經允許請勿轉載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。
轉載請注明本文地址:http://systransis.cn/yun/29067.html
摘要:是一個開放源代碼的程序調試器即一個工具,可以用來跟蹤,調試和分析程序的運行狀況。以下為安裝示例,安裝請參考集成開發(fā)和斷點調試環(huán)境的配置。指令的配置路徑必須是絕對路徑。 Xdebug是一個開放源代碼的PHP程序調試器(即一個Debug工具),可以用來跟蹤,調試和分析PHP程序的運行狀況。以下為Windows+Phpstorm+Xampp+Xdebug安裝示例,MAC安裝請參考集成開發(fā)和斷...
摘要:經過鳥哥等眾位大神打磨了年的,終于出了發(fā)布了版本,安裝,真是非常地向下兼容,下載,解壓,把之前的配置命令用上,一路回車下去,毫無違和感。首先當然是下載版本的源碼包了,去的官網下載即可,為了方便起見,附上下載鏈接。 經過鳥哥等眾位大神打磨了2年的PHP 7,終于出了發(fā)布了alpha版本,安裝,真是非常地向下兼容,下載,解壓,把之前的配置命令用上,一路回車下去,毫無違和感。 首先當然是...
視頻地址 學徒卡夫 - 卡夫的Mac 03 - Mac下使用Docker配置PHP環(huán)境 https://www.bilibili.com/vide... 安裝 Docker https://www.docker.com/docker... 下載鏡像 # 安裝基礎鏡像 - ubuntu:14.04 # 拉取鏡像(拉取鏡像經常會失敗,嘗試幾次就好了) docker pull ubuntu:14.0...
視頻地址 學徒卡夫 - 卡夫的Mac 03 - Mac下使用Docker配置PHP環(huán)境 https://www.bilibili.com/vide... 安裝 Docker https://www.docker.com/docker... 下載鏡像 # 安裝基礎鏡像 - ubuntu:14.04 # 拉取鏡像(拉取鏡像經常會失敗,嘗試幾次就好了) docker pull ubuntu:14.0...
摘要:先發(fā)一下電腦配置,電腦版本如下圖安裝步驟如下請確保電腦已經關閉。關閉的方法去問下載并且解壓。安裝前前依賴安裝編譯安裝參數如下安裝步驟如下和一樣先下載下載依賴包編譯安裝參數修改將修改為之后的不用修改修改后的如 先發(fā)一下電腦配置,電腦版本如下圖:showImg(https://segmentfault.com/img/bVYEUW?w=586&h=354); PHP安裝步驟如下: 請確...
閱讀 3636·2023-04-25 23:32
閱讀 2049·2019-08-30 15:55
閱讀 2664·2019-08-30 15:52
閱讀 3123·2019-08-30 10:54
閱讀 851·2019-08-29 16:16
閱讀 658·2019-08-29 15:09
閱讀 3663·2019-08-26 14:05
閱讀 1644·2019-08-26 13:22