PHPStorm CLI debugging on Vagrant instance

时间:2015-07-28 15:56:54

标签: php debugging vagrant phpstorm

I'm trying to get PHPStorm to work with Xdebug to use with PHP scripts (CLI, not web pages!) on a vagrant instance on the same machine as PHPStorm is running on.

In their docs they say this:

To tell the PhpStorm which path mapping configuration should be used for a connection from certain machine, the value of the PHP_IDE_CONFIG environment variable should be set to serverName=SomeName, where SomeName is the name of the server configured in Settings / Preferences | Languages & Frameworks | PHP | Servers:

Windows: set PHP_IDE_CONFIG="serverName=SomeName" Linux / Mac OS X: export PHP_IDE_CONFIG="serverName=SomeName"

However, it's unclear where I'm supposed to set this-- is it set somewhere in the PHPStorm app? Is it set as part of the bash profile in the vagrant box? In the vagrant xdebug conf?

1 个答案:

答案 0 :(得分:0)

根据LazyOne评论,自v8以来,PhpStorm支持通过SSH直接调试CLI脚本(通过远程PHP解释器) - 在那里你不需要做任何类似的事情。但是您可能需要设置SFTP部署并在创建Remote PHP Interpreter时使用它(这取决于:在某些情况下,IDE无法使用/解释来自vagrant配置文件的路径映射。

请参阅: