I am using chrome and mozilla. My editor is Notepad++. I just try to setup a debugger for php. I have followed this link and this link
I found it from SO answers. My steps are
Downloaded `php_xdebug-2.3.2-5.6-vc11-x86_64.dll` and placed inside `php\ext`.
Added the following lines in `php.ini`
zend_extension=php_xdebug-2.3.2-5.5-vc11-x86_64.dll
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_mode=req
xdebug.idekey=default
xdebug.remote_log="c:\temp\xdebug\xdebug.log"
xdebug.show_exception_trace=0
xdebug.show_local_vars=9
xdebug.show_mem_delta=0
xdebug.trace_format=0
xdebug.profiler_enable = 1
xdebug.profiler_output_dir ="c:\temp\xdebug"
Created xdebug folder in temp. My system is windows 64 bit. Php version is 5.6.2. [Restarted Apache - no error]
Then downloaded DBGp plugin and placed dll file inside plugins directory of Notepad++;
[Restarted Npp]
plugins->DBGp -> Config
127.0.0.1 EMPTY htdocspath htdocs path
htdocs path is c:\Users\me\Server\Apache24\htdocs
Set breakpoints and started my page with the paramaeter ?XDEBUG_SESSION_START=debugMe
But it doesn't stop at my break points.
How do i solve this or My ultimate aim is to debug step by step PHP. What are the other options.
I am not really sure of notepad, but I have tried this on netbeans and works ok.
Tip: I tried to use this debugger with netbeans in real projects but sincerely is better do this step by step.
I also use FirebugPHP in console this option is the best for me because does not disturb the view
Following links maybe help you:
https://netbeans.org/kb/docs/php/debugging.html
http://wiki.netbeans.org/HowToConfigureXDebug
http://www.firephp.org/
https://enboliviacom.wordpress.com/2013/03/25/analizar-el-rendimiento-de-las-consultas-sql-en-aplicaciones-php-con-firephp/
I found it worked when I gave the full path of the dll in php.ini
zend_extension="C:\Program Files (x86)\PHP\ext\php_xdebug-2.2.6-5.3-vc9.dll"
I take it you are also setting breakpoints with the DBGp plugin in Notepad - gives red dot in margin. What I also found is that when the debug stops at the line, the green arrow to show the current line is under the red dot and not that obvious.
EDIT:
Use of session.save_path setting also affects DBGp, it only works on the last site mentioned. Therefore make sure the localhost root is mentioned last:
;Application xyz must keep session variables separate
[PATH=C:\inetpub\wwwroot\xyz]
session.save_path = "C:\temp\xyz"
;...etc
;Must have this for DBGp to function on all localhost sites
[PATH=C:\inetpub\wwwroot]
session.save_path = "C:\temp"
Related
I am having a hard time with PhpStorm debugger. I read all their documentation and I have setup debug properly (according to both phpinfo(), debug tailored installation report and PhpStorm analysis).
However, no matter what I try, the debugger wont trigger.
My setup is the following:
I changed XAMPP document root to: c:\src\project\www
My project has the following structure:
project
| www (used by XAMPP to serve the website)
| src
| --theme (symlinked to wp-content/themes)
| --plugins (symlinked to wp-content/plugins)
and apparently, this setup works as all my plugins and theme are correctly working and displayed on the screen.
When I then start to run the debugger, it simply won't trigger.
This is the setup for the debugger on PhpStorm:
Server:
Host: localhost
Port: 80
Debugger: xdebug
Mappings (where I think there's something off)
src/theme --> c:/src/project/www/wp-content/theme/
src/plugins --> c:/src/project/www/wp-content/plugins/
but nothing happens. No mappings errors, no debug, nothing at all.
Can you please explain to me what am I doing wrong here?
let me know if you need more info.
EDIT:
php.ini added line for debug (from xdebug website):
zend_extension = C:\xampp\php\ext\php_xdebug-2.5.4-7.1-vc14.dll
PhpStorm PHP settings:
This is from my setup :
php.ini
[xdebug]
;zend_extension=xdebug.so
zend_extension=/usr/local/Cellar/php55-xdebug/2.4.0/xdebug.so
xdebug.remote_enable=1
xdebug.remote_connect_back=0
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9002
xdebug.remote_log="/mnt/log/xdebug.log"
xdebug.remote_autostart=1
xdebug.idekey=phpstorm
xdebug.remote_mode = req
phpstorm :
setup in accordance with above parameters. Note that I use port 9002 to skit around a conflict with php-fpm which is part of my stack. Also, i force xdebug logging on a specific drive to ease the burden on my laptop SSD, etc ... Adapt to your configuration.
No one says but you may need to add to xampp/xamppfiles/etc/php.ini:
xdebug.mode=debug,develop
together with server setup:
I'm using PHPStorm and Xdebug. I'm trying to debug a Web Application Project configured in my localhost. There are no symbolic links in my project path.
Below is Xdebug configuration in my php.ini:
[Xdebug]
xdebug.remote_port=9000
xdebug.remote_enable = 1
xdebug.remote_autostart = 1
xdebug.profiler_enable=1
xdebug.remote_host=localhost
xdebug.remote_handler=dbgp
xdebug.idekey = "PHPSTORM"
xdebug.profiler_output_dir="/tmp"
xdebug.remote_log="/tmp/xdebug.log"
zend_extension=/usr/local/php5/lib/php/extensions/no-debug-non-zts-20160303/xdebug.so
Below are two variables exported in my zsh:
export PHP_IDE_CONFIG="serverName=localhost"
export XDEBUG_CONFIG="idekey=PHPSTORM"
Below is server configuration:
Below is debug configuration:
Below is the screenshot of first breakpoint where I see no variable values.
Below is the screenshot after 'Step In'. It shows: Waiting for incoming connection with ide key 'PHPSTORM'.
I get below message in event log:
Debug session was finished without being paused.
It may be caused by path mappings misconfiguration or not synchronized local and remote projects.
To figure out the problem check path mappings configuration for 'dev.sales-crm.com' server at PHP|Servers or enable Break at first line in PHP scripts option (from Run menu).
My problem is: after debugging is started, then control stops at first breakpoint. It shows no variables values. Then If I try to 'step into', then debugging stops.
Please help me. Below is the link to xdebug logs: xdebug.log
I upgraded my Xdebug version form Xdebug 2.5.0rc1 to Xdebug v2.5.0 and it started working.
Thank you very much.
I have recently bought a new computer. Previously I was running Windows 7 and PHPStorm 8 with PHP 5.5 (From WAMPServer) with XDebug 2.2.5. Everything was fine with this.
I am now on a new computer (Windows 8) with PHPStorm 8 and I cannot get XDebug to work correctly. I have not installed WAMPServer, but instead simply "lifted out" the PHP from my old hard disk. Maybe I should do this, but I wanted to avoid having the Apache server and MySQL as I don't want/need them on this computer.
Both installations (old and new) simply used the PHP Built-in web server for testing/debugging applications with.
I have been searching on Google and not found anyone else with a similar problem to mine neverless I have tried using multiple different snippets of configurations.
What happens
In my index.php I have added a phpinfo statement followed by die to simply spit out the PHP info and stop the application. I have put a breakpoint on the phpinfo line, and am expecting the IDE to pause here.
If I do Run > Debug > index.php (which launches a command line PHP session and simply executes index.php as a console app, the IDE does as expected and pauses at my breakpoint.
If I "Run" the Built-in web server, and hit localhost/index.php the IDE does not pause at my breakpoint although it does output the phpinfo.
It is behaving as though I have not pressed the telephone icon in PHPStorm, even though as I described in the console route it does pause at the breakpoint.
I confirm that the phpinfo output does indicate the XDebug is enabled and does reflect the settings in php.ini
php.ini extract
zend_extension = "c:/php/5.5/zend_ext/php_xdebug-2.2.5-5.5-vc11.dll"
[xdebug]
xdebug.remote_enable = on
xdebug.remote_host = 127.0.0.1
xdebug.profiler_enable = off
xdebug.profiler_enable_trigger = off
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir = "c:/php/tmp"
xdebug.show_local_vars=0
xdebug.remote_port=9000
xdebug.idekey=PHPSTORM
xdebug.remote_mode=req
xdebug.remote_handler=dbgp
xdebug.remote_connect_back=0
xdebug.remote_autostart=0
xdebug.remote_log="C:/php/xdebug.log"
phpinfo output:
http://i.stack.imgur.com/hV8Rk.png
http://i.stack.imgur.com/GPf4o.png
I had even added in the xdebug.log bit to see what happens here, stopped and started the PHP Web server and tried the index.php call again, the log file was not created, so I have created it manually and granted full permissions in Windows. Tried the process again, and the file hasn't had any text added to it.
Text is added to the file, if I use that Run > Debug > index.php (console) route.
I think I am missing something ridiculous and obvious I just haven't a clue what it is.
Sorry for asking such a noob question, this is driving me mad!
I have used XDebug semi-sucessfully with PhpStorm and Mamp, but now I want to try using NetBeans for a project. But I can't get NetBeans to connect to XDebug. It just waits until I stop the debugger and then I get a message that NetBeans never got a connection to XDebug, and it asks me to check the settings in php.ini.
Now, as I said it has worked ok with PhpStorm, so I don't think there should be anything wrong with the settings in php.ini, but anyway, here they are:
[xdebug]
zend_extension="/Applications/MAMP/bin/php/php5.3.6/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so"
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=localhost
xdebug.remote_port=9000
One thing that I found strange was that everyone talks about php.ini being located in /Applications/Mamp/conf, but in that folder there is no php.ini in my setup at least. In /Applications/Mamp/bin/php/php5.3.6/conf on the other hand, there is. So that's the one I have modified. And since it works in PhpStorm I figure it must be right...
But then, why isn't NetBeans able to connect? I'm also using the XDebug plugin for Safari to hook it up in the browser. And the port in NetBeans is set to 9000 as in the php.ini file.
I'm using NetBeans 7.0.1 and php5.3.6.
Anything else I'm missing?
EDIT:
Well, I found the problem for why XDebug wasn't connecting anyway: I am using the add-in for Safari for XDebug, and apparently it had it's own setting for IDE Key, set to 1, while NetBeans had netbeans-xdebug set. Once I changed it to the latter in the add-in I got a connection. The problem is I still get some sort of error. It says: 404 Page not found when I hit the debugger, and the address in the address field is: http://localhost/app_netbeans/index.php?XDEBUG_SESSION_START=netbeans-xdebug
Any idea what is going on here?
BTW, just hitting run inside NetBeans works fine and opens http://localhost/app_netbeans (I have used mod_rewrite to remove the index.php part of urls in CodeIgniter)
EDIT 2:
I found that the index.php part of the address was because in the run configuration in NetBeans there was an "index file" setting that was set by default to index.php. If I removed that to have CodeIgniter "controller" urls without the index.php I got the correct url, but with the xdebu stuff appended after it. But still I get the 404 Page not found when I use the debugger command, but not when I use the run command.
Weirdly enough what I can do is I can hit debug, ignore the fact that it goes to 404 Page not found, and go back to the IDE, hit run and if I have a breakpoint set it will then stop at that breakpoint.
But again, this is not exactly what I would consider normal debugging behaviour... So if anyone knows what is going on I would love to hear it...
Use this config and make sure you update Netbeans to use port 9001.
[xdebug]
zend_extension="/Applications/MAMP/bin/php/php5.3.6/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so"
xdebug.remote_host=localhost
xdebug.remote_port=9001
xdebug.remote_enable=1
xdebug.idekey="netbeans-xdebug"
I found that the port 9000 sometimes conflicts with other applications, and xdebug seems to fail silently if it cant use it.
use the following code..
zend_extension="path to the xdebug.so"
;;;;;;;;;;;;;;;;;;;
; Module Settings ;
;;;;;;;;;;;;;;;;;;;
[xdebug]
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
and also make sure the port in the netbeans is correct. you can check that in
goto tools menu and select options
in options click on the php and check the port number.
Mine is finally working, so I wanted to post my full php.ini configuration:
[xdebug]
; got this script from https://netbeans.org/kb/docs/php/configure-php-environment-mac-os.html
xdebug.default_enable=1
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9001
xdebug.remote_autostart=1
xdebug.idekey="netbeans-xdebug"
zend_extension="/Applications/MAMP/bin/php5.3/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so"
xdebug.remote_log="/Applications/MAMP/logs/xdebug_remote.log"
You may also check if your project is configured to copy to a different directory in the Netbeans project settings. After I changed this setting I had to restart Netbeans and MAMP using the quit command.
Just to note:
No index.php in my start up properties
Stop at first line is turned off in debugging preferences
I do think changing to port 9001 made a difference on my system
I've got a lot of questions about how to debug php-files with xdebug and eclipse on a remote server.
What I would like to achieve is:
I have a remote server (with WAMPP (appache (Port 8502), php, mysql (Port 8501), etc)) and I would like to debug the php-files with Eclipse PDT from my local PC.
I prepared the following things:
Installed Eclipse PDT (Build id:
20100617-1415) on my local PC
Installed and activated xdebug on the
remote server (available at (lets
say) 111.111.111.111:8502) with the
following configuration within the
php.ini
[XDebug]
zend_extension = C:\TYPO3_4.4.6\php\ext\php_xdebug-2.1.0-5.3-vc6.dll
xdebug.profiler_output_dir = "C:/xampp/tmp/xdebug"
xdebug.profiler_output_name = "cachegrind.out.%p"
xdebug.profiler_enable = 0
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=ECLIPSE_DBGP
xdebug.remote_log="C:\TYPO3_4.4.6\tmp\xdebug\xdebug_remote.log"
xdebug.show_exception_trace=0
xdebug.show_local_vars=9
xdebug.show_mem_delta=0
xdebug.trace_format=0
In Eclipse I added the server in
"Window - PHP - PHP Servers" with the
URL "http://111.111.111.111:8502" and
the Path Mapping - Path on Server:
"C:\TYPO3_4.4.6\htdocs" and Path in
Workspace: "/debug_test" (I created a
PHP Project named "debug_test").
I also changed the PHP - Debug to the following:
PHP-Debugger: XDebug
Server: 111.111.111.111
PHP Executable None Defined
Next I added the debug configuration (PHP Web Page):
Server Debugger: XDebug
PHP Server: 111.111.111.111
File: /debug_test/debug.php
Break at first line: off
Auto Generate: on
I created the file debug.php on the Remote Server at C:\TYPO3_4.4.6\htdocs\debug_test\ and within my PHP Project ("debug_test").
If I now run "Debug" and choose my Configuration File, the Webpage pops up (in an external browser) with the URL http://111.111.111.111:8502/debug_test/debug.php?XDEBUG_SESSION_STOP_NO_EXEC=ECLIPSE_DBGP&KEY=129657398681515 and the page is (fully) loaded as a normal page, but there is no way to debug it. Even If I switch to the PHP Debug - View and insert any breakpoints or things like this, there is nothing like debugging.
How do I get to the point that I can do remote debugging with xdebug and eclipse pdt?
Cheers,
Cheeesi
are you sure that your XDebug-Client / PC can be reached by 127.0.0.1 from your server?
B/c if I understand you correctly the your server is not installed on your PC. OTOH then I'm wondering about how you set up ypur XAMPP-system. B/c then usually all your stuff is locally installed.
Also the Browser's behaviour is important. If after invoking an XDebug-session through Eclipse your site is fully loaded, then your XDebug-Client in Eclipse couldn't reach your server. If you see your browser trying to load the page but it's stalling, then your client could tell the server to start an XDebug-session but your XDebug on the server couldn't connect back.
Your port 8502 that you specify for your server is also bit odd, but could be correct, given the corresponding configurations.
Best regards
Raffael
EDIT: and for a first try you should enable break on first line