mac電腦安裝 xdebug


1、安裝pecl

參考:https://blog.csdn.net/zerovszero1/article/details/98946925

curl -O http://pear.php.net/go-pear.phar

sudo php -d detect_unicode=0 go-pear.phar

執行以上命令,提示如下錯誤:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">

<html><head>

<title>301 Moved Permanently</title>

</head><body>

<h1>Moved Permanently</h1>

<p>The document has moved <a href="https://pear.php.net/go-pear.phar">here</a>.</p>

</body></html>

更新命令:

1.1下載:curl -O https://pear.php.net/go-pear.phar

1.2安裝:sudo php -d detect_unicode=0 go-pear.phar

輸入1,回車,配置pear路徑為:/usr/local/pear

輸入4,回車,配置命令路徑為:/usr/local/bin

回車

回車

結束~

1.3查看版本號 pecl -V

2、確認環境 

參考:https://blog.csdn.net/u010953609/article/details/101027077

php -v

pecl -V

3. 下載安裝包

https://xdebug.org/download.php

 cd Downloads/
mkdir xdebug
mv xdebug-latest.tgz xdebug
cd xdebug/

sudo pecl install xdebug-2.9.3.tgz 提示如下錯誤,需要安裝brew。

91 source files, building

running: phpize

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.

 

ERROR: `phpize' failed

3.1 安裝brew

參考:http://yangjunwei.com/1599.html

xcode-select --install

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

可能會遇到如下提示的錯誤:

curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused

  額原因不明,反正重試一次好了

出現如下內容,enter,輸入密碼,等待安裝

Press RETURN to continue or any other key to abort
Password:

 

下載需要流量,如果網絡不好,就等網絡好了再安裝吧~

brew -v

3.2 執行 brew install autoconf,

參考:http://yangjunwei.com/2413.html

3.3 繼續在xdebug目錄中執行 sudo pecl install xdebug-2.9.3.tgz 

提示新錯誤

/private/tmp/pear/install/xdebug/xdebug.c:25:10: fatal error: 'php.h' file not found
#include "php.h"
         ^~~~~~~
1 error generated.
make: *** [xdebug.lo] Error 1
ERROR: `make' failed

  然后就重頭來了 不知道會不會成功

tar zxf xdebug-2.9.3.tgz

cd xdebug

phpize

./configure

sudo make && make install 

一樣的錯誤………………

 

然后執行xcode-select --install

提示:xcode-select: error: command line tools are already installed, use "Software Update" to install updates

然后又執行

sudo rm -rf /Library/Developer/CommandLineTools

然后再執行xcode-select --install

再彈出的安裝提示框中點擊安裝即可,(需要很久,需要網絡佳)

成功后,再執行:

sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /

然而我的電腦目錄中 /Library/Developer/CommandLineTools/沒有Packages……

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM