I'm weaning myself off of PhpStorm for the inevitable day my student license expires. I'm trying to set up PDT (comments regarding other free PHP environment suggestions are appreciated, but do not answer the question).
Anyways, when I add a PHP executable, there is a mandatory option for a debugger. Leaving the default at Zend, when attempting to run a hello world file with the big green button I get a
"Launch Error - Session Terminated"
"Error launching testFile The session could not be started.
In order to generate debug information, please make sure that the debugger is properly configured as a php.ini directive."
The question is basically - is this error generated because I haven't set up a debugger? But it follows, if so, to ask if it is possible to use PDT without a debugger. If it is not possible, why? You don't need a debugger for PhpStorm. Is it simply a matter of Eclipse not supporting this use case, or is there a gap of my understanding of the toolchain and is PhpStorm doing something significant to make itself work without a debugger?
And I guess, is there any reason to actually want to not install a debugger besides (the probably negligible) overhead to actually setting it up?
Of course you can use PDT without a debugger. Due to this bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=462020, you have to configure executable with xdebug.
You can also create official bug on bugs.eclipse.org to add "none" in php cli configuration.
EDIT:
In PDT 3.5 (Eclipse 4.5 - Mars release), we added "NONE" as possible choice. See: https://bugs.eclipse.org/bugs/show_bug.cgi?id=467260
Related
I am using Google Chrome, Eclipse 2020 to Xdebug PHP on Manjaro Linux. I don't want Eclipse to run the debugger every time I need to check the script. Is there a way (an easy way) to disable Xdebug and re-enable it every time I want? Thank you!
Yes, use one of the browser extensions, as is explained in the Xdebug documentation: http://xdebug.org/docs/step_debug#web-application
You can just toggle whether Xdebug needs to initiate a request or not. The IDE needs to be in "listen mode", although I am not sure whether this is something that Eclipse supports. PhpStorm and the Xdebug plugin for VS Code do.
Zend Eclipse for PHP Developers Version: 3.2.0
php5.4.12 (wamp)
I'm using php eclipse xdebug for a few years now - sometime the xdebug doesn't break.
I notice that it happen mostly on ajax calls, and I found that one cause is that the previous debug session didn't end.
But now I'm debugging an ajax call,
I'm using the chrome devtool and I do 'replay XHR' to run the exact same ajax call, and it doesn't break 2 out of every 3 runs.
This is a great waste of time for me and I would appreciate any idea of how to overcome it, including a suggestion for a different (and better debugger)
Note:
upgrading the php is not an option because I must use the same version as the production sev.
I also tried upgrading the eclipse - but it causes to many (other) issues
In eclipse->preferences->PHP->Debug->Installed debuggers
choose Xdegbug, and click configure
check the Use Multisession checkbox
click ok
This will cause xdebug to break even when a session is already running - but it can be a pain when submiting multiple requests.
Linux Mint 15, Aptana Studio 3.4.1, Chromium 28.0.1500.71
Sorry, this is a little lengthy to explain. Please let me know if something's not clear.
The title is my goal. I have a local server set up with Apache2. I don't know if it matters, but I have dnsmasq set up to redirect, for example, site.dev/index.html to /home/wastvedt/Projects/site/www/index.html (described here).
I've followed the tutorials I can find. XDebug is running, I have the helper installed in Chromium, and the debugger, interpreter, and web server set up in Aptana.
I'm working on a WordPress site and want to break on one of the functions in my theme's functions.php file. I created a breakpoint in the function in Aptana, turned on the XDebug helper in Chromium, and updated a post, which calls the function in question. Aptana recognizes what I'm doing and prompts me with the option of breaking on the first line. Regardless of what I select, I see "XDebug JIT Session [Remote Launch]" in the Debug view. The prompt appears three times, but nothing else happens in Aptana.
I think the problem might have something to do with linking files in the editor to files in Apache. When I try this JIT debugging thing with "localhost" (located at /home/wastvedt/apache2/www/index.php), Aptana brings up /home/wastvedt/Projects/site/www/index.php. This isn't right, but maybe the real problem is somewhere else. To be honest I'm a little lost now.
Any thoughts? I'd provide some sort of dump or output, but I'm not sure which or what.
Thanks for reading,
Trygve
In order to properly setup XDebug with Aptana I setup the below options by going to the Window menu -> Preferences -> Aptana Studio -> Editors -> PHP -> Debug:
Allow multiple debug sessions: Always
Break on first line when an unknown remote sessions (JIT): Never
Then click on XDebug in Installed Debuggers -> Configure:
Use Multisession: OFF
Accept remote session (JIT): any
That pretty much made it work for me.
I am using Eclipse PDT Helios with Aptana Studio on Windows XP SP3.
Very often, my workflow is interrupted because Eclipse starts a DLTK indexing process that lasts 30 seconds, sometimes up to 2 minutes - which is annoying.
I wonder if there is any way to:
Either turn that off or
Run the DLTK indexing process less frequently.
I didn't find any possibility to change regarding parameters in Window > Preferences.
PDT 2.2 (the one in Helios) is using a local database engine, H2, to store information. I wrote a post highlighting how to improve the performance of the new indexer.
There might be another way, but it's requires hacking and I haven't tried it myself since the early builds of PDT 2.2 so YMMV: use a newer version of H2. You see, PDT 2.2 uses H2 version 1.1.117. The current version is 1.2.140. Basically, it involves downloading a newer version from the h2 site, and replacing the current H2 JAR in the plugins folder with this Jar. I should really write a blog post about it. I just need to find some time...
I also have/had this problem and turned off "Build Automatically" in the projects menu.
Which seems to have resolved the problem for me...
So question is, and please excuse my ignorance here... but what is "Build" required for in PHP world.
There are some issue currently being worked out with the dltk.core.index process:
See bug 319130 from yesterday (August 4th).
I'm using Zend Studio to do remote debugging of my php scripts on a dev server. It works great for web code, but can I make it work with command line scripts?
I have several helper apps to make my application run. It would be really useful to fire up the remote debugger through command line instead of a web browser so I can test these out.
I assume it's possible, since I think Zend is using xdebug to talk to Eclipse. Apparently, it adds some parameters to the request to wake the Zend code up on a request. I'm guessing I'd need to tap into that?
UPDATE
I ended up using xdebug with protoeditor over X to do my debugging.
I was able to get remote CLI debugging working in Eclipse, using xdebug, though I've not tried it with the zend debugger. I would assume this should work the same with ZSfE, if that's the "Zend Studio" you're using.
Since this is more along the lines of product support, your best bet is probably emailing the support people. We bought Zend Studio at my last job and they were always able to help us in a matter of hours.
Feel free to post the answer though, I am sure there are more people looking for it. :)
There's an option to debug a php script,
run->run as->php script
I believe it also has to be in your project root though. Just for clarification, Zend studio uses their own debugger, while the eclipse pdt project you have the option for Xdebug or Zend's debugger.
Haven't tried, but you can set the QUERY_STRING environment variable to the one that toggles the Zend debugger on.
Per this article.
export QUERY_STRING=start_debug=1&debug_host=<host name or IP of the local machine>&debug_port=<the port that is configured in your ZDE settings>&debug_stop=1
And then run the CLI script.
Remote command-line debugging is possible, I just tried it.
In my case I used Zend Studio + Zend Debugger.
This official article here by the Zend people will help you out, it's what I used. It explains all the parameters that must go into the shell command.
Make sure that you have the php.ini properly set on the remote server, and that it allows your IP address and it will work.
Also, you don't need to export the QUERY_STRING variable.
You can just do:
QUERY_STRING="start_debug=1&debug_host=[127.0.0.1]&no_remote=0&debug_port=10137&debug_stop=0" /path/to/php/binary /your/php/script.php
Running that on an SSH shell will light up your Zend Studio. Sweet!