Mac+Apache+PHP安裝Xdebug方法步驟

藏色散人
發布: 2023-04-08 11:30:02
轉載
2450 人瀏覽過

Mac+Apache+PHP安裝Xdebug方法步驟

MAC homebrew自2018/3/31之後棄用homebrew/php

By 31st March 2018 we will deprecate and archive the Homebrew/php tap. Unfortunately we have been unable to maintain an acceptable, consistent user or contributor experience and CI workload through non-core formula taps in the Homebrew organisation so we are continuing to migulad and woo​​r leow ​​m​​almerr 它't 課'! supported outside the Homebrew organisation.

詳細:https://brew.sh/2018/01/19/homebrew-1.5.0/

所以不能再用下面的方法安裝xdebug了,下面的方法不行!下面的方法不行!下面的方法不行!

brew install php<version number>-xdebug
登入後複製

所以,安裝xdebug我們可以手動編譯一下,具體步驟如下:

1.首先進入Xdebug 官方下載頁面:https://xdebug.org/download.php ,下載安裝php版本支援的xdebug的版本

eg.我本地的PHP版本是5.6.38,所以下載了2.5.4的source,一個tgz壓縮包

#2.在下載xdebug的資料夾裡開啟終端機

tar -xzf xdebug-2.5.4.tgz
cd xdebug-2.5.4
登入後複製

也可以在本地直接解壓,再進入解壓縮的xdebug的資料夾裡,開啟終端機

phpize
登入後複製

#如果不可以,寫phpize的完整路徑

./configure
登入後複製

上面指令執行之後,開始編譯

make -j2
登入後複製

編譯完成之後,會提示,在modules可找到xdebug.so檔案

Mac+Apache+PHP安裝Xdebug方法步驟

3.將編譯之後得到的xdebug.so檔案可以拷貝到extension_dir規定的資料夾中

註:php.ini 中搜尋extension_dir

 

4.在php.ini設定參數

[Xdebug]
zend_extension="/usr/local/lib/php/pecl/20131226/xdebug.so"
;自动跟踪,可关闭(关闭后提升性能)
xdebug.auto_trace=On
;性能分析,可关闭(关闭后提升性能)
xdebug.profiler_enable=On
xdebug.var_display_max_children=512
xdebug.var_display_max_data=2048
xdebug.var_display_max_depth=8
登入後複製

 修改完後,重新啟動apache,phpinfo()偵測一下安裝上了沒,應該是沒問題了

更多php相關知識,請造訪php教學

以上是Mac+Apache+PHP安裝Xdebug方法步驟的詳細內容。更多資訊請關注PHP中文網其他相關文章!

相關標籤:
來源:cnblogs.com
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!