Console output for a PHP script?

I am trying to debug a standalone PHP script. I have created a 'PHP Script' configuration. When debugging using that configuration the output from the script does not show in the Console window - ie. echo statements in the script do not produce anything in the PHPStorm Console.

Am I missing something? Where does the output of the script is supposed to show in PHPStorm? Is there a configuration setting somewhere, or for xdebug?

5 comments
Comment actions Permalink

Hi Nicolas,

Works fine for me here (at very least on this very basic and simple code). Does it work for you?

<?php
$a = 'abbra cadabra';
echo $a, "\n";


$b = 'Mamma mia!';
echo $b, "\n";


$c = $a . ' <=> ' . $b;
echo $c, "\n";


exit();


Maybe you have output buffering turned on?

0
Comment actions Permalink

Does not work for me, with the same code. See screenshot below.
Is there a configuration setting that could cause this behavior?



Attachment(s):
phpstorm console.png
0
Comment actions Permalink

1) I see no screenshot

2)

Is there a configuration setting that could cause this behavior?

In PhpStorm -- nope (I 'm not aware of any). In xdebug or PHP -- maybe -- post your php.ini (or at very list outputof phpinfo(); )

3) Have you check this?

Maybe you have output buffering turned on?
0
Comment actions Permalink

Sorry Andriy, I edited my previous post to attach the screenshot.
There is no output buffering since I copied your script verbatim.
It also cannot be an issue with php.ini since when launching the script from a command prompt I do get the output.

So it must be either with PHPStorm, or xdebug.

0
Comment actions Permalink

So .. what are your xdebug settings are? I have these and it just works:

[xdebug]
xdebug.collect_includes = 1
xdebug.collect_params = 3
xdebug.collect_return = 0
xdebug.collect_vars = 0
xdebug.default_enable = 1
xdebug.dump_globals = 1
xdebug.dump_once = 1
xdebug.dump_undefined = 0
xdebug.extended_info = 1
;xdebug.max_nesting_level = 100
xdebug.overload_var_dump = 1
xdebug.profiler_append = 0
xdebug.profiler_enable = 0
xdebug.profiler_enable_trigger = 1
xdebug.profiler_output_dir = D:\php_temp\xdebug
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.remote_autostart = 0
xdebug.remote_enable = true
xdebug.remote_host = 127.0.0.1
xdebug.remote_mode = req
xdebug.remote_port = 9000
xdebug.remote_handler = dbgp
xdebug.show_exception_trace = 0
xdebug.show_local_vars = 1
xdebug.show_mem_delta = 1
xdebug.trace_format = 0
xdebug.trace_options = 0
;xdebug.trace_output_name = trace.%c
xdebug.trace_output_dir = "D:\php_temp\xdebug"
;xdebug.var_display_max_children = 128
;xdebug.var_display_max_data = 512
xdebug.var_display_max_depth = 4


Standard PHP 5.4.8 (x86) with xdebug 2.2.1 on Windows 7 SP1 x64

0

Please sign in to leave a comment.