簡體   English   中英

如何在 Apache 中啟用 XDebug 而不是在 CLI 中?

[英]How to enable XDebug in Apache but not in CLI?

我想在由 Apache 運行的 PHP 中啟用 XDebug 模塊,但不是為 CLI php命令啟用。 我在 Mac 上,我安裝了 Homebrew 的 Apache (httpd) 和 PHP 7.3。

PHP 在啟用 XDebug 的情況下運行速度要慢得多,即使我沒有調試給定的php命令。

CLI 和 Apache 有單獨的 php.ini。 /etc/php/7.3/有一個apache2cli目錄。 要在 'apache2/php.ini' 中啟用 Xdebug,請添加以下幾行:

xdebug.remote_autostart=1  
xdebug.remote_enable=1

對於 Xdebug 的分析器:

xdebug.profiler_enable=1

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM