我是靠谱客的博主 纯真钥匙,最近开发中收集的这篇文章主要介绍phpedit下的xdebug的配置,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

Configuring PHP
First, you need to download the correct version of the Xdebug extension for PHP, and install it with the other extensions in your PHP installation directory. See this page for help on downloading the correct version of Xdebug.


Once Xdebug is installed, you need to activate it in PHP's configuration file, php.ini. Add the following lines in your php.ini file:


[Xdebug]
zend_extension="c:/full/path/to/php_xdebug.dll"
xdebug.remote_enable=on
;xdebug.remote_port=9000
xdebug.profiler_enable_trigger=on
xdebug.profiler_output_dir="./profiler"
xdebug.profiler_output_name="cachegrind.out.%t"
xdebug.file_link_format = "phpedit://openLocalFile/%f?lineNumber=%l"


Detail of each line:


zend_extension="c:/full/path/to/php_xdebug.dll"
Loads the xdebug extension mode. If you are using a version older than PHP 5.3, like PHP 5.2, then the line should be:


zend_extension_ts="c:/full/path/to/php_xdebug.dll"
Note 1: Make sure to enter an absolute path to the .dll.


Note 2: There can be only one extension loaded with zend_extension or zend_extension_ts at given time. This means that Xdebug is not compatible with other Zend engine extensions, like for example the Zend Optimizer extension. If you have trouble making Xdebug work, make sure it is the only extension loaded like this.


Note 3: If the php_xdebug.dll file appears twice in your php.ini file, like for example if there's also a "extension=php_xdebug.dll" line, it will prevent debugging from working normally. If you have trouble making Xdebug work, make sure it appears only once in your php.ini, and that it is with zend_extension or zend_extension_ts.


xdebug.remote_enable=on
This line activates debugging with PHPEdit in Xdebug.


;xdebug.remote_port=9000
This line sets the port for connections to PHPEdit. It is commented here, because we keep the default value (9000). This port has to be the same as the one configured in PHPEdit's Xdebug preference page, see above.


xdebug.profiler_enable_trigger=on
xdebug.profiler_output_dir="./profiler"
xdebug.profiler_output_name="cachegrind.out.%t"
These lines enable the profiler. It will allow you to do profiling sessions with PHPEdit. You can change the  xdebug.profiler_output_dir setting to change the output directory of profiling files.


xdebug.file_link_format = "phpedit://openLocalFile/%f?lineNumber=%l"
This lines makes Xdebug create special formated links when it is displaying error callstacks. This links can be handled by PHPEdit, which will open the file at the correct position.

最后

以上就是纯真钥匙为你收集整理的phpedit下的xdebug的配置的全部内容,希望文章能够帮你解决phpedit下的xdebug的配置所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(60)

评论列表共有 0 条评论

立即
投稿
返回
顶部