Xdebug on XAMPP and Notepad ++ will not connect

I have a very slow script from someone else that I need for profiling to speed up, I followed numerous tutorials, but it continues to lead to the same step.

I downloaded the corresponding binary from the xDebug site by copying phpinfo to the search function on the Xdebug site find_binary.php .

I have a seemingly correct setup.

Notepad ++ (NPP) is configured to connect to Xdebug through 127.0.0.1:9000 with the specified IDE key.

The following is the php.ini section specific to xdebug.

[xdebug] zend_extension_ts="C:\xampp\php\ext\php_xdebug.dll" xdebug.remote_enable=1 xdebug.remote_host=localhost xdebug.remote_port=9000 xdebug.remote_handler=dbgp 

I am using PHP 5.4.4.

My phpinfo release does not mention Xdebug.

+4
source share
2 answers

For windows with php5.3 and you need to use zend_extension instead of zend_extension_ts in the php.ini file.

Example

 zend_extension="C:\xampp\php\ext\php_xdebug.dll" 

If you use the xdebug wizard http://xdebug.org/wizard.php and you get this message, Xdebug only loads as a PHP extension and not as a Zend extension This is due to the use of zend_extension_ts (I think).

One more remark.

You will not see anything in notepad unless you set breakpoints in the code under test. It will work so fast that it will seem like it is not working (if you carefully monitor it, but the notepad plus will blink). I understood this a long time ago.

Thirdly

I would recommend downloading the latest xdebug.dll for your system, available from http://xdebug.org/download.php

xdebug is only compatible with php 5.4 since [2012-05-08] - Xdebug 2.2.0 Latest version of Xdebug 2.2.1

I also recommend using the latest version of the DBDG plugin (notepad plus requires this file to work with Xdebug) from http://sourceforge.net/projects/npp-plugins/files/DBGP%20Plugin/

OTHER THING

EDIT: Just noticed that you are using XAMPSERVER, but I will leave it in case it is useful to someone else. If you are using wampserver 2.2, xdebug is pre-installed. This can cause problems if you manually installed xdebug later and can install 2 versions or something like this.

My latest php.ini working file for xdebug

Please note that my latest version worked, albeit very slowly. In php.ini, I have an ideal set in xdebug, but I could name it any session name I wanted and it worked. You probably do not need all the information that I posted below, and you most likely need to change the file path and file name. I used a D-disk.

 [xdebug] ;for windows with php5.3 and up you need to use zend_extension instead of zend_extension_ts zend_extension="D:\wamp\bin\php\php5.4.3\ext\php_xdebug-2.2.1-5.4-vc9-x86_64.dll" xdebug.remote_autostart=on xdebug.profiler_output_dir = "d:/wamp/tmp/xdebug" xdebug.profiler_output_name = "cachegrind.out.%p" xdebug.profiler_enable = 1 xdebug.profiler_append=0 xdebug.extended_info=1 xdebug.remote_enable=1 xdebug.remote_handler=dbgp xdebug.remote_mode=req xdebug.remote_host=127.0.0.1 xdebug.remote_port=9000 xdebug.idekey=xdebug xdebug.remote_log="d:/wamp/tmp/xdebug/xdebug_remot.log" xdebug.show_exception_trace=On xdebug.show_local_vars=9 xdebug.show_mem_delta=0 xdebug.trace_format=0 

enter image description here

FINALLY

Remember to use ?XDEBUG_SESSION_START=sessionname at the end of the URL of the code you want to verify.

Example

 http://localhost/codetotest.php?XDEBUG_SESSION_START=xdebug 

Also restart the server services after making any changes, otherwise they will not take effect.

+11
source

For Windows 8, recent xamp php 5.5, make sure you have VC11 and xdebug dll: php_xdebug-2.2.3-5.5-vc11.dll, and paste the above php.ini fixes with d: dir replaced by c: path to your xamp. It is imperative to replace localhost with 127 ....

0
source

Source: https://habr.com/ru/post/1436048/


All Articles