我正在使用 netbeans 7.3 来调试我的 laravel 3.2 项目。我无法让 xdebug 工作,因为它不会在断点处停止(顺便说一句,相同的设置适用于 codeigniter 项目,所以我不认为它是 IDE 或 xdebug)。
我在项目属性->运行配置对话框中设置了以下参数:
project URL: http://localhost/my_project/public/my_controller
index file: blank
arguments: blank
它运行良好,只是 xdebug 不起作用。有人可以帮我让它工作吗?
我的开发堆栈是http://www.easyphp.org/。在底部的 php.ini 文件中,我有:
我刚刚通过量身定制的安装说明运行了我的 phpinfo,并得到了:
Tailored Installation Instructions
Summary
Xdebug installed: Only as PHP extension!
Server API: Apache 2.4 Handler Apache Lounge
Windows: yes - Compiler: MS VC9 - Architecture: x86
Zend Server: no
PHP Version: 5.4.6
Zend API nr: 220100525
PHP API nr: 20100525
Debug Build: no
Thread Safe Build: yes
Configuration File Path: C:\Windows
Configuration File: F:\EZPHP\apache\php.ini
Extensions directory: F:\EZPHP\php\php546x130301155435\ext
Instructions
Warning: You seem to have Xdebug loaded as a normal PHP extension only. This will cause odd issues, please see the FAQ entry on it.
Download
Move the downloaded file to F:\EZPHP\php\php546x130301155435\ext
Edit F:\EZPHP\apache\php.ini and add the line
zend_extension = F:\EZPHP\php\php546x130301155435\ext\
Restart the webserver
我试过这个,但我注意到它没有说明要下载哪个版本。我下载了 32 位线程安全版本,现在在 php.ini 的底部:
Xdebug
;zend_extension = "${path}\php\php546x130301155435\php_xdebug-2.2.1-5.4-vc9.dll"
zend_extension = "F:\EZPHP\php\php546x130301155435\ext\php_xdebug-2.2.2-5.4-vc9.dll"
xdebug.default_enable=0
xdebug.remote_enable=1
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_autostart = false
xdebug.dump_globals=1
xdebug.dump=COOKIE,FILES,GET,POST,REQUEST,SERVER,SESSION
xdebug.dump.SERVER=REMOTE_ADDR,REQUEST_METHOD,REQUEST_URI
xdebug.show_local_vars=1
xdebug.show_mem_delta=1
xdebug.collect_includes=1
xdebug.collect_vars=1
xdebug.collect_params=4
xdebug.collect_return=1
xdebug.auto_trace=0
xdebug.trace_options=0
xdebug.trace_format=0
xdebug.trace_output_dir="${path}\xdebug\trace"
xdebug.trace_output_name="trace.%t"
xdebug.profiler_enable=0
xdebug.profiler_append=1
xdebug.profiler_enable_trigger=1
xdebug.profiler_output_dir="${path}\xdebug\profiler"
xdebug.profiler_output_name="cachegrind.out.%s.%t"
;/Xdebug
;PHPExt
extension=php_bz2.dll
extension=php_curl.dll
;extension=php_fileinfo.dll
extension=php_gd2.dll
;extension=php_gettext.dll
;extension=php_gmp.dll
;extension=php_intl.dll
;extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_ldap.dll
extension=php_mbstring.dll
;extension=php_exif.dll
extension=php_mysql.dll
extension=php_mysqli.dll
;extension=php_oci8.dll
;extension=php_oci8_11g.dll
extension=php_openssl.dll
;extension=php_pdo_firebird.dll
extension=php_pdo_mysql.dll
;extension=php_pdo_oci.dll
;extension=php_pdo_odbc.dll
;extension=php_pdo_pgsql.dll
extension=php_pdo_sqlite.dll
;extension=php_pgsql.dll
;extension=php_pspell.dll
;extension=php_shmop.dll
;extension=php_snmp.dll
;extension=php_soap.dll
extension=php_sockets.dll
;extension=php_sqlite.dll
extension=php_sqlite3.dll
;extension=php_sybase_ct.dll
;extension=php_tidy.dll
;extension=php_xmlrpc.dll
extension=php_xsl.dll
extension=php_yaz.dll
;/PHPExt
按照指示,在我的文档根目录中放置一个文件,其中包含
Configuration File (php.ini) Path C:\Windows
Loaded Configuration File F:\EZPHP\apache\php.ini
作为补充说明,我刚刚发现当我在 xdebug_break() 中硬编码时它会中断