如何使用xdebug只调试一个虚拟主机?


How can I use xdebug to debug only one virtual host?

我已经安装了xdebug,我可以在phpinfo()中看到它已经安装(但它是关闭的)。

但是,我不想为整个服务器/apache2启用它,我只想为一个虚拟主机启用它。

我该怎么做?

您可以在php.ini中设置xdebug, off值:

zend_extension=/usr/lib/php/modules/xdebug.so
xdebug.remote_enable off
xdebug.remote_port 9000
xdebug.idekey PHP-XDEBUG

和只打开.htaccess指令:

php_flag   xdebug.remote_enable on