是否可以在 php 内置 Web 服务器上使用 xdebug?
问题描述:
我有一台装有 apache2 和 php7 的计算机,我将 php.ini
设置为使用 xdebug 并且没问题,我可以使用编辑器进行调试.
I have a computer with apache2 and php7, I setup the php.ini
to use xdebug and its ok, I can debug using an editor.
但是我想在另一台只有 php 的电脑上调试.
But I want to debug in another computer that has only php.
我使用以下命令启动服务器:php -S localhost:8080
I started the server using: php -S localhost:8080
我尝试使用相同的php.ini
,但似乎php内置的Web服务器无法理解php.ini
I tried to use the same php.ini
, but it seems that php built-in web server can't understant the php.ini
我使用的命令是:php -S localhost:8080 -c <<path to my php.ini>>
这里是apache服务器的phpinfo输出:
Here the phpinfo output from apache server:
这里是内置网络服务器的输出:
and here the output from built-in web server:
答
你需要在-S
之前通过php.ini
:
php -c /path/to/php.ini -S localhost:8080