我想在Mac OS 10.11的xampp5.5.16上安裝xDebug,照此頁面提示的步驟操作。輸入phpinfo()的資訊後,頁面的提示
圖片描述
提示中沒有說要把下載下來的檔案放在哪裡,所以我就在下載目錄中解壓縮,進行到第4步運行phpize時,Terminal中的返回資訊是
grep: /usr/include/php/main/php.h: No such file or directory grep:
/usr/include/php/Zend/zend_modules.h: No such file or directory grep:
/usr/include/php/Zend/zend_extensions.h: No such file or directory
Configuring for: PHP Api Version:
Zend Module Api No:
Zend Extension Api No:
Cannot find autoconf. Please check your
autoconf installation and the $PHP_AUTOCONF environment variable.
Then, rerun this script.
我想這可能是xDebug檔案夾沒有放對地方。我試著把它移動到xamppfiles/
和xamppfiles/modules/
以及其他的一些檔案夾下再執行phpize,但是還是返回相同的錯誤資訊。
頁面上有一個返回出錯資訊時的FAQ連結,點進去有如下資訊:
Q: How do I find which phpize to use?
A: Run: "phpize --help". This shows you the full path to phpize. This path should be the same as where you have the CLI binary, "php-config" and the "pear" and "pecl" binaries installed. If you run "php-config --version" it should show the same version of PHP that you're running. If it doesn't match up, and perhaps the wrong "phpize" binary is found on the path, you can run configure as follows:
/full/path/to/php/bin/phpize
./configure --with-php-config=/full/path/to/php/bin/php-config
但這個我看不太懂,我的phpize --help返回是/usr/bin,但我不知道CLI binary以及php-config的目錄是究竟是哪裡,在xampp目錄下也找不到pear 和pecl。
雖然用PHP編程已有一定時間,但因為有很多PHP的概念還是不甚清楚,所以基本的安裝都碰到這麼多問題,求高手指點。
回複內容:
我想在Mac OS 10.11的xampp5.5.16上安裝xDebug,照此頁面提示的步驟操作。輸入phpinfo()的資訊後,頁面的提示
圖片描述
提示中沒有說要把下載下來的檔案放在哪裡,所以我就在下載目錄中解壓縮,進行到第4步運行phpize時,Terminal中的返回資訊是
grep: /usr/include/php/main/php.h: No such file or directory grep:
/usr/include/php/Zend/zend_modules.h: No such file or directory grep:
/usr/include/php/Zend/zend_extensions.h: No such file or directory
Configuring for: PHP Api Version:
Zend Module Api No:
Zend Extension Api No:
Cannot find autoconf. Please check your
autoconf installation and the $PHP_AUTOCONF environment variable.
Then, rerun this script.
我想這可能是xDebug檔案夾沒有放對地方。我試著把它移動到xamppfiles/
和xamppfiles/modules/
以及其他的一些檔案夾下再執行phpize,但是還是返回相同的錯誤資訊。
頁面上有一個返回出錯資訊時的FAQ連結,點進去有如下資訊:
Q: How do I find which phpize to use?
A: Run: "phpize --help". This shows you the full path to phpize. This path should be the same as where you have the CLI binary, "php-config" and the "pear" and "pecl" binaries installed. If you run "php-config --version" it should show the same version of PHP that you're running. If it doesn't match up, and perhaps the wrong "phpize" binary is found on the path, you can run configure as follows:
/full/path/to/php/bin/phpize
./configure --with-php-config=/full/path/to/php/bin/php-config
但這個我看不太懂,我的phpize --help返回是/usr/bin,但我不知道CLI binary以及php-config的目錄是究竟是哪裡,在xampp目錄下也找不到pear 和pecl。
雖然用PHP編程已有一定時間,但因為有很多PHP的概念還是不甚清楚,所以基本的安裝都碰到這麼多問題,求高手指點。
這票事兒你得這麼來,首先報錯提示已經明確告訴你錯誤和對應的操作了,提示你要用php-config自動協助編譯。那你就得先找到它。
試試find命令,當然前提是你得在類unix系統,win的面壁吧?。
sudo find / -name "php-config"
不過最好先來一句
phpize
如果有任何不對勁的提示,說明phpize這貨也不在環境變數的目錄裡,你得用上面命令再揪出它的真身在哪兒,然後直接用絕對路徑執行
/oo/xx/phpize
類似這樣。
用這個命令把那倆貨揪出來,有了絕對路徑你就可以按照提示編譯了
./configure --with-php-config=這裡填絕對路徑
預祝你渡過此劫(-.-;)
1、你要先確定php 安裝的位置,如果你通過 xampp 安裝,那就基本上在 xampp 安裝的檔案夾裡面。
2、如果使用mac,建議使用 brew 安裝php,nginx 等常用服務。