Debugging CommandLine PHP running on Linux from Windows

Hi,

I'm a longtime and enthusiastic user of PHPStorm (since v2) and have always admired the remote debugging facility.

I'm now writing some command line scripts in PHP and would like to do the same for this.

Are there any particular videos I should look at?

I guess the principles would be the same, ie.setup xdebug in the CLI version of php.ini, but the way in which the PHP script is launched remotely must be different?

Or maybe I should wrap my CLI script into a fake web-page? That would have different privileges for system access, but I might be able to get away with that by granting injudicious rights to www-user!

Any help welcome....

0
1 comment

Hi there,

Simple scenario:

1) Create SFTP deployment entry and mark it as Default for this project
2) Define Remote PHP Interpreter and choose it for this project
3) Just use ordinary CLI debug ("PHP Script" type of Run/Debug configuration)

Now IDE will connect to your remote host and will execute your script via SSH.

Obviously, xdebug still should be installed and configured on remote server

If SFTP/SSH is not available -- you can look at https://youtrack.jetbrains.com/issue/WI-7906

If working with docker containers: https://devnet.jetbrains.com/message/5533649#5533649

Related links:

0

Please sign in to leave a comment.