Web Debugging working but CLI Debugging not. Stops script but shows no code

Hi,

i'm trying to get CLI debugging to work. I can debug successfully browser requests, but not scripts called via command line on the server.

It's remote debugging. There are no error messages.

It just opens the script in the debugging window, with no content(no code). I can step through nothing, continue and stop the script.

My CLI php.ini:

zend_extension = /usr/lib/php/20180731/xdebug.so
xdebug.mode=debug
xdebug.client_host=127.0.0.1
xdebug.client_port=9003
xdebug.remote_connect_back = 0
xdebug.remote_enable=1
xdebug.start_with_request=yes

 

web php.ini

zend_extension = /usr/lib/php/20180731/xdebug.so
xdebug.mode=debug
xdebug.client_host=127.0.0.1
xdebug.client_port=9003
xdebug.remote_connect_back = 0
xdebug.remote_enable=1
xdebug.start_with_request=yes
0

Is it a remote debugging via SSH tunnel? Did you run through our CLI Debugging instructions? Try launching the script using the options listed here: https://www.jetbrains.com/help/phpstorm/debugging-a-php-cli-script.html#start-script-with-debugger-options

0

Yes it is via SSH Tunnel. The script is being called by a cronjob & daemon, so launching the script manually is not a valid option.

Yes i followed the instructions. SSh tunnel, cli interpreter from the remote server

As soon as i start the daemon, the debugger stops the script( i did not set any breakpoints ) and does not display any code. But i can stop it. It stops every time the script is being called.

Do i need to configure the SSH tunnel for CLI debugging differently than for browser debugging?

0

Again Browser debugging works fine

0

> As soon as i start the daemon, the debugger stops the script( i did not set any breakpoints ) and does not display any code. 

Sorry I didn't get this part: you need breakpoints for a script to be stepped by IDE to step through it. Unless you have Break at first line in PHP scripts checkbox enabled at Settings (Preferences on macOS) | PHP | Debug.

Is it possible to record a video showing what happens when you start the script? And also show what file should be opened during debugging.

0

I got it. The problem was i did not set the environment variable correct.

PHP_IDE_CONFIG

And i had to set the mapping again

1

Thanks for the follow up.

0

请先登录再写评论。