Xdebug profiling not save logs to the folder - php

I am on windows 10 OS.
I want to use profiling , I have done some steps which articles says those are enough for Xdebug can save logs but no use I can not find any log in the mentioned folder.
I want to share my configuration with you . Please guide me even google not helped me related this.
Added lines on php.ini
[XDebug]
xdebug.mode = profile;
xdebug.start_with_request = yes;
xdebug.profiler_enable = 1
xdebug.profiler_output_dir = "C:\db\xdebug"
xdebug.profiler_output_name = "callgrind.out.%t-%s"
php.ini
alt text
I have enabled the downloaded extension on Extension section.
Even https://xdebug.org/wizard says the installation done.
Do you have any idea what is problem?

I already solved the problem.
Xdebug 3 has some changes. After reviewing of the changelog, this change needs to be made:
from
xdebug.profiler_output_dir="D:\Soft\laragon\www\xdebug"
to xdebug.output_dir="D:\Soft\laragon\www\xdebug"
You can review all changes via this link.

Related

Why does xDebug do not work with Php Storm on Ubuntu?

I have installed xdebug and tried to use it with phpstorm. But it doesn't want work correctly.
I tried to put following settings to /etc/php5/apache/php.ini and /etc/php5/mods-avaible/xdebug.ini:
zend_extension="xdebug.so"
; Debugging
xdebug.remote_enable= 1
xdebug.remote_port= 9000
xdebug.idekey = "PHPSTORM"
; Var-Display
xdebug.var_display_max_children = 2048
xdebug.var_display_max_data = 8192
xdebug.var_display_max_depth = 99
xdebug.max_nesting_level = 3000
I thought the `xdebug.ini should be the correct place for this settings.
Then I restarted apache with sudo service apache2 restart and opened a page where I print out phpinfo(). But as you can see on screenshot - it says all the time netbeans-xdebug.
What can I do? I searched my whole system for other php.ini files, but there aren't any other files.
This is what works for me.
zend_extension="/usr/lib/php5/20121212/xdebug.so"
[xdebug]
xdebug.remote_enable = on
xdebug.profiler_enable = off
xdebug.show_local_vars=0
xdebug.max_nesting_level = 500
But run following command first to locate xdebug.so
locate xdebug.so
and change following line accordingly
zend_extension="/usr/lib/php5/20121212/xdebug.so"
Solution to my problem.
I figured out that in my browser, even after restarting my system (obviously) a cookie XDEBUG_SESSION=netbeans-xdebug was causing this problem.
After deleting it and reloading my phpinfo() page, my new idekey is PHPSTORM and now xdebug works with my ide.
I think the problem was that I installed xdebug and tried it with my ide without setting it up - so (default?) value for idekey was this netbeans-xdebug value. And as soon as the cookie is set, it will ignore php settings as long as this cookie is alive.
It usually happens (if the path to xdebug.so is correct) because the remote_enable is set to off.
xdebug.remote_enable=on
might solve the issue.

Debug Project in PhpStorm

I have been searching for a satisfactory answer on the net and StackOverflow without success. How should I debug Magento as a whole application — not a single file — using the PhpStorm IDE? You can do this in Visual Studio, Netbeans, and IntelliJ IDEA but I need to know how to debug an application, such as Magento, using PhpStorm.
When I try to run the debugger on a controller, such as C:\xampp\htdocs\coinandbuillion\app\code\core\Mage\Checkout\controllers\CartController.php, a bunch of errors get thrown because PhpStorm is trying to execute the file directly rather than working through the application dispatcher in index.php.
So does anyone know how to debug automatically from the initialization point of application till the end?
Here is snapshot what i got. I cant debug after that button click.
Finally I did it !!! :) Please refer steps I followed.
Install Jetbrain's chrome extension from Here.
Now follow steps as below.
In 3rd snapshot in image. your Built in server port(mine is 63342) may be different for you,I didnt change it , it was already there(default), I have just shown it. I changed other options only.
That's it !!
Edit 1:
IF you have problem writing all xdebug setting in php.ini from diagram 1, here it is text version: Don't change paths exactly like i have because you may have xampp/wamp installed on other drive, in different folder. So please add paths like zend_extension accordingly.
[XDebug]
zend_extension = "C:\xampp\php\ext\php_xdebug.dll"
xdebug.profiler_append = 0
;xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_dir = "C:\xampp\tmp"
xdebug.profiler_output_name = "cachegrind.out.%t-%s"
xdebug.remote_enable = 1
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "127.0.0.1"
xdebug.trace_output_dir = "C\xampp\tmp"
xdebug.remote_port = 9000
xdebug.idekey=PHPSTORM
Ensure following :
Ensure you have Installed Chrome Extension from Here
Make sure xampp/wamp server is running.
Make sure Xdebug debugger is configured.
If not , Goto File->Settings -> search PHP and follow diagram as follows

How to debug PHP in Notepad++ with DBGp plugin

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"

Getting xDebug listed on WampServser Debug Menu

OK, been banging my head against the wall again for a few days. Trying to follow a suggestion from another answer on SO here: https://stackoverflow.com/questions/11955822/php-file-caching-vs-cache-through-htaccess . In trying to set up a local test environment with xDebug, I downloaded WampServer because it said that it was a complete package that came with xDebug included. I have tried various settings in PHP.ini, but cannot get xDebug to appear on the Debug menu of WampServer. I saw an image of a Wamp menu that had it listed in the Debug menu, along with WebGrind that I do have, but cannot accomplish the same feat.
Here are my current PHP.ini settings for xDebug (that includes a few rem'd out):
; XDEBUG Extension
;zend_extension = "c:/wamp/bin/php/php5.3.13/zend_ext/php_xdebug-2.2.0-5.3-vc9.dll"
zend_extension = c:\wamp\bin\php\php5.3.13\ext\php_xdebug-2.2.1-5.3-vc9.dll
[xdebug]
xdebug.default_enable = On ;added
xdebug.remote_enable = On ;Off
xdebug.remote_port = 9000 ;added
xdebug.remote_handler="dbgp" ;added
xdebug.remote_host="localhost" ;added
xdebug.profiler_enable = On
xdebug.profiler_enable_trigger = On ;Off
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir = "c:/wamp/tmp"
xdebug.trace_output_dir = "c:/wamp/tmp" ;added
;xdebug.show_local_vars=On
;xdebug.dump.SERVER=HTTP_HOST, SERVER_NAME
;xdebug.dump_globals=On
;xdebug.collect_params=4
;xdebug.show_local_vars=1
Yes, I am aware that there are two separate PHP.ini files in Wamp, but making the change in both does nothing.
I have tried the "custom installation" instructions on the xDebug website, but that does not do anything.
phpinfo file lists it as being installed.
I can find the xDebug client in the Wamp tool's folder and open it, but the open file option on the xDebug menu is grayed out and does not work.
I have explored and tried various solutions found here on the SO website, but still no joy.
I even found a nice step by step installation webpage for WampServer and xDebug here http://www3.ntu.edu.sg/home/ehchua/programming/howto/WampServer_HowTo.html, but all I succeeded in doing was downloading another very large program called eclipse, installing and configuring that, but still nothing. This does appear to be a nice looking program, but after doing the configuration, it does not seem to associate with wampserer either.
xDebug and wampserver do appear to be very common issues asked here on SO...so any ideas that actually work???
BTW: is there any way of increasing the font size in this question and comments box here on SO, so I do not have to use a magnifying glass to see what I am typing??? I know that it is repeated down below but it is a lot easier to see what you are typing, where you are typing...just my two cents...
Thanks for any assistance,
Stan...
Try Following these Steps
Open your Wamp Server phpinfo() page.
Copy Evrything in it Using a Big Control+A and the Paste it in the xDebug Wizard. Here is the link
http://xdebug.org/wizard.php
Now Download the DLL file provided by the Wizard and put it in your wamp/bin/php/php/ext folder.
Paste the Following Code in your php.ini file at the very end...
NOTE: use php.ini under wamp/bin/apache/apache/bin/php.ini
zend_extension="C:/Softwares/wamp/bin/php/php5.3.8/ext/php_xdebug-2.2.0-5.3-vc9.dll"
[xdebug]
xdebug.remote_enable=on
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
Hope this works fine for you. I got this information after working 3 to 4 days to get xDebug on NetBeans. :)
Remove the "" from *zend_extension*
Remove ; infront of zend_extension
And finally use this code in PHP.ini both files.
[xdebug]
xdebug.profiler_enable = off
xdebug.profiler_enable_trigger = off
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir = "c:/wamp/tmp"
xdebug.remote_enable=1
xdebug.remote_host="localhost"
xdebug.remote_port=9000
xdebug.remote_handler="dbgp"
To work with xdebugclient, you need to add XDEBUG_SESSION_START=session_name as a parameter to the URL, where session_name is the name of your debug session.

XDebug not working with xampp

I'm using (or trying to anyway) use the bundled XDebug with XAMPP 1.7.2. It comes bundled with Apache 2.2.12, PHP 5.3.0, XDebug 2.0.5 and Zend (not sure on version)
This is a totally fresh install of XAMPP, the only thing I've added to php.ini (at xampp/php/php.ini) is:
zend_extension_ts = "C:\xampp\php\extensions\php_xdebug.dll"
[xdebug]
xdebug.auto_trace = 1
xdebug.collect_includes = 1
xdebug.collect_params = 1
xdebug.collect_return = 1
xdebug.default_enable = 1
xdebug.extended_info = 1
xdebug.show_local_vars = 0
xdebug.show_mem_delta = 1
xdebug.trace_format = 1
xdebug.trace_options = 0
xdebug.trace_output_dir ="C:\xampp\tmp"
xdebug.remote_enable=1
xdebug.remote_mode="req"
xdebug.remote_host=127.0.0.1
xdebug.remote_port=17869
xdebug.idekey=<idekey>
xdebug.remote_handler="gdb"
xdebug.auto_profile = 1
xdebug.auto_profile_mode = 2
xdebug.output_dir = "C:\xampp\tmp"
xdebug.dump.SERVER = REMOTE_ADDR,REQUEST_METHOD
(this is only one of many different configs I've tried)
But try as I might, XDebug just will not connect to anything. I've tried Netbeans and Debugclient.exe (in xampp/php/debugclient.exe). They both just sit and wait forever.
How do I get XDebug to work?
My case was quite annoying. Everything was right except for one unexpected thing. The config line
zend_extension = \xampp\php\ext\php_xdebug-2.2.5-5.5-vc11.dll
generated by the XDebug website is wrong. I had to change to
zend_extension = php_xdebug-2.2.5-5.5-vc11.dll
Hope it may save some time if anyone has the same problem as me in the future
If you havent solved this issue. Just in case and for anyone looking for an answer. Go to localhost (if your using XAMPP that is) and click on the left menu's link phpinfo(). Then click anywhere on the table and press "Ctrl + C'. Then go to http://xdebug.org/find-binary.php and paste all the info that you just copied from the table in the white text-box. Click the link below and youll have the right fil to download plus some instructions. Copy that file that you just downloaded into the location stated in the instructions (ie. C:\xampp\php\ext - in my case im using XAMPP 1.7.7). Go to your php.ini file that should hopefully be in 'C:\xampp\php\php.ini' and look for the kay-word '[XDebug]'. No copy the line 'zend_extension = C:\xampp\php\ext\php_xdebug-2.1.3-5.3-vc9.dll' (in my case) under the ';zend_extension = "C:\xampp\php\ext\php_xdebug.dll"' line. Note: make sure you dont put the ';' at the beginning of the new line that you just pasted. Now go ahead and uncomment all the 'exdebug.FUNCTION_NAME' lines that are at the bottom of each block of text.
Restart you server. Go back to your phpinfo() page, copy the table as you did before and paste it in the xDebug website. This should be enough for you to get it working.
PD: make sure that the file that you download from xDebug is approximately 147kb as there has been some instances where people download small files (ei. 3kb).
Let me know how it goes. :)
Xdebug v2.0 shouldn't work with PHP 5.3.
Xdebug v2.1 provides PHP 5.3 support. Otherwise I would get rid of the xdebug ini config except:
zend_extension_ts = "C:\xampp\php\extensions\php_xdebug.dll"
xdebug.remote_enable = On
xdebug.remote_host = "localhost"
xdebug.remote_port = 9000
xdebug.remote_handler = "dbgp"
use this as your test and once this works then add additional configs. Make sure you comment out other zend stuff.
The joomla web site has a great tutorial on getting XAMPP, XDebug, and Eclipse (Netbeans is configured in the same fashion) working together and they cover all major operating systems.
http://docs.joomla.org/Setting_up_your_workstation_for_Joomla!_development
I have faced such a type of problem where i configured as xdebug said for the xampp 1.7.2. Couldn't work. I just changed the zend_extension_ts to zend_extension. it works for me.

Categories