PHP Echo Statements don't show in Browser Output in Eclipse w/ XDebug? - echo

I am testing XDebug on Xampp using win7-64 with Eclipse PDT. I am debugging a simple script that echoes statements. I can step over these statements, but the internal web browser window doesn't show these statements until after the entire script has finished running. I tried entering phpinfo() at the top of the script and it displays in the browser just fine immediately after stepping over it. Has anyone run across this issue and is there a way to fix it?

Editing the following lines in php.ini solved the issue for me:
implicit_flush = On
output_buffering = 0

Add the ob_get_contents() Eclipse expression, you will see the buffer!

maybe it's buffering output?
tried flush() ?
http://php.net/manual/en/function.flush.php

Related

VS Code debugger doesn't step into

I didn't find an answer to this problem with nodejs:
I have a breakpoint in index.js at the line require("./test). When I click the Step Into button, the debugger doesn't jump to the test file like it should, but instead runs and displays the result immediately. I don't have any expressions for watching.
P.S https://github.com/microsoft/vscode/issues/15253 - this issue from github is the same as mine
Kind regards
I found the problem ,tried to reproduce on my personal laptop and the debugger was worked fine(node v18.14.0). On my work laptop node version were 19.16.0.I switched to 18.14.0 and the debugger starts work as expected.

Why is my command prompt freezing on Windows 10?

I'm adding this question after spending an entire day wrestling with this incredibly frustrating feature of the Windows 10 command prompt which made me think there was something wrong with my console application code. I hope it will help someone.
Issue: My console application seems to randomly stop running. What is going on?
The issue ended up being a new feature of the windows 10 console. Under the default config, whenever you click on a command window in windows 10, it immediately halts the application process when it attempts to write to the console. When this happens, the command window has gone into "selection" mode.
You can tell it has happened because it will prefix the title bar of the command window with the word "Select" :
To get your program running again, you have to press escape or click somewhere else.
To get rid of this strange behavior, you can disable QuickEdit mode:
What I'd like to add here to Shaun Rowan's answer is that for it to work in all console windows you have to click "Defaults", instead of "Properties" and make your changes there, as described in this post.
I faced this problem very recently where one of the users (who had Quickedit configured on his Command Prompt) was using a tool I developed in Java, and was getting the tool frozen while running it from command prompt.
Finally what solved the problem was to redirect the logging inside the batch script to a file as shown below:
#echo off
...
java.exe -jar mytool.jar
needed to be updated to
java.exe -jar mytool.jar > log.txt

pydev remote debugging blocks when running to completion

I'm following these instructions to remotely debug a python script http://pydev.org/manual_adv_remote_debugger.html
Using breakpoints and stepping work without a problem, but after resuming the script (without any other further breakpoints) the script executes the remaining instructions, and then hangs instead of exiting normally. Even closing the server from pydev does not help, I have to Ctrl+Break the script
I am sure I've done this a while ago with an older eclipse+pydev, and the script resumed and exited normally (and it's very important for me not to mess the rest of the execution).
I've tried this with both Eclipse Luna and Liclipse pydev_4.0.0.201504132356, pydev_4.0.0.201504092214 on Windows 7 x64, same behaviour
Is this an intended behavior or a bug? How could I make pydev let the script end normally?
I can't reproduce this here... please report that as a bug adding details on how to reproduce it (i.e.: ideally, create a project on github and add a step-by-step on how to reproduce it so that it can be fixed... without being able to reproduce it properly, it may be pretty hard to fix).
Also, please give details on the OS and Python version used in the report (https://sw-brainwy.rhcloud.com/tracker/PyDev/)

Eclipse not noticing changes to eclipse.ini?

I have had a problem lately with jvisualvm not allowing me to take heap dumps and showing very little information at all. I believe this is my problem.
I made the suggested changes to eclipse.ini. It currently looks like this:
The line in question here is then line 19.
Now, when I check the configuration in Eclipse, the new option doesn't show up.
I have restarted Eclipse twice, both via File -> Restart and closing and re-opening, with no effect. Also, I have changed the order of the options in the file, with no effect.
What might cause this and can this be fixed somehow?
EDIT: I also tried closing Notepad++ and then restarting. No effect. type in the command prompt still shows the changes, so they are there.
I managed to solve it by running Eclipse in clean mode, as described here.
I ran Eclipse from the command prompt:
C:\Program Files (x86)\Eclipse>eclipse -clean
This can be done in other ways also, as seen the answer linked above.
At this point, the problem is solved. The rest of the steps are what happened.
I had to choose my workspace again, as the cache had been cleared.
Package Explorer failed to load.
After one more restart, everything worked fine.

Python module will not run correctly from command prompt

This goes out to anyone who is well versed in the Eclipse IDE and or PyDev perspective plug-in who is willing to offer some technical support.
I am trying to write a python module that must take in arguments from the command prompt with sys.argv function calls. Rather than printing out the correct output when I enter E:\ ... \src>program.py arg1 arg2, all that happens is a new command line (E:\ ... \src>) is output and the Eclipse IDE window flashes orange without any code in my python module actually being executed. Also, if I close the Eclipse IDE and try to run program.py, it will just open Eclipse again and open my program in a new tab.
I'm confused as to why it is not working now when just last week it was working perfectly while testing another program that took in arguments from the command prompt by sys.argv function calls. My question for everyone is whether or not you are aware of any settings that may have been altered by updates, etc. that could cause this problem; or has anybody out there ever run into this problem and figured out how to resolve it? I have already checked my PATH variable, so that is not the problem :-(. Any help you can provide would be greatly appreciated ... thank you.
OS: Windows 8.1 Pro / Eclipse ver.: Kepler (4.3) / Python ver.: 3.3.2
I answered my own question in the comment above. I just had to wait to post an answer due to the fact that I just created a stackoverflow account yesterday.