用 Atom 进行 PHP 调试
我尝试使用Atom来调试PHP的内置服务器。
The given phrase “前提” can be paraphrased in Chinese as “基本条件” (jī , which means “basic requirement” or “prerequisite.”
以下软件已安装:
– PHP(5.4及以上版本)
– Xdebug
– Atom的php-debug插件
设定
如果不知道php.ini的位置,请使用phpinfo()函数确认,并在php.ini中添加以下设置。
zend_extension="/usr/lib/php/extensions/no-debug-non-zts-20121212/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_host=127.0.0.1
xdebug.remote_connect_back=1
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_autostart=true
启动内置服务器
根据在php.ini中设置的xdebug端口进行启动。
php -S localhost:9000 -t [DocumentRootのフルパス]
或者,您可以先进入文档根目录,然后启动。
cd [DocumentRootのフルパス]
php -S localhost:9000
在atom中进行调试
打开调试窗口

在中国,设置断点.

访问目标页面
