I
I
Ivan Panteleev2013-07-29 23:36:54
PHP
Ivan Panteleev, 2013-07-29 23:36:54

Debugging a remote script with xdebug+phpstorm

So, there is a script that is launched on a remote server by cron every N minutes, I need to debug it, I didn’t think of anything better than looking towards remote debugging through xdebug. But so far it has not been possible to put it into practice. My provider issues one external ip to the entire network, so I can’t be seen from the outside. Is this a significant problem when setting up remote debugging? Or is it a bigger problem that the script being run is located outside the root folder of the web server and there is no way to access it through the browser line?

Answer the question

In order to leave comments, you need to log in

6 answer(s)
O
OnYourLips, 2013-07-30
@OnYourLips

Or is the bigger problem that the script being run is outside the root folder of the web server and there is no way to access it through the browser line?

And what does the browser have to do with it? Xdebug can debug console scripts, but the browser has nothing to do with it.
Forward port over ssh.

S
Sergey Cherepanov, 2013-07-30
@fear86

What if you forward the port via ssh?

D
Daedmen, 2013-07-30
@Daedmen

VPN

E
EugeneOZ, 2013-07-30
@EugeneOZ

habrahabr.ru/post/146547/ - that's about remote debugging, but how to catch cron - it would be interesting to know for yourself.

K
karser, 2013-08-06
@karser

XDEBUG_CONFIG="idekey=PhpStorm1" php ./cron.php
Don't forget to enable the "Start Listening PHP Debug Connections" button in PhpStorm.
I wrote about remote debugging here

O
Oleg Batishchev, 2014-08-04
@z0rg

1. Forward the port in the router.
2. Configure xdebug correctly: remote_connect=1, remote_port=9000, remote_enabled=1
3. Get DynDNS on the router (more convenient than locally). Or always substitute your ip in xdebug.remote_host

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question