Last active
March 17, 2023 14:36
-
-
Save Im0rtality/9710254 to your computer and use it in GitHub Desktop.
Revisions
-
Im0rtality revised this gist
Mar 22, 2014 . 2 changed files with 19 additions and 8 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,9 +1,4 @@ ### In host: 1. Go to PHPStorm `Settings > Project settings > PHP > Servers` 2. Add server with following parameters: @@ -12,4 +7,17 @@ In host: - Debugger: Xdebug - [v] Use path mappings - Map your project root in host to relative dir in guest - Hit OK 3. PHPStorm > Run > Start listen for PHP Debug connections 4. Put a breakpoint ### In guest: 1. Find where your Xdebug config is stored. Run `$ php -i | grep ini` and look for `*xdebug.ini` or `*custom.ini` - depends on configuration (mine was in `/etc/php5/cli/conf.d/zzzz_custom.ini`) 2. Add following `xdebug.remote_host = 11.22.33.1`, when box ip is `11.22.33.*` 3. Create file `/usr/bin/debug` with contents added below (file `debug` below) 4. Make it executable `$ sudo chmod 0777 /usr/bin/debug` 5. Run your script prefixed with `debug`: - `$ debug app/console cache:clear` 6. Debugger window should open in IDE This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,2 +1,5 @@ #!/bin/sh env PHP_IDE_CONFIG="serverName=vagrant" XDEBUG_CONFIG="idekey=PHPSTORM" $@ # for Symfony apps use following # env PHP_IDE_CONFIG="serverName=vagrant" XDEBUG_CONFIG="idekey=PHPSTORM" SYMFONY_DEBUG="1" $@ -
Im0rtality revised this gist
Mar 22, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,6 +10,6 @@ In host: - Name: `vagrant` (same as `serverName=` in `debug` script) - Host, port: set vagrant box IP and port - Debugger: Xdebug - [v] Use path mappings - Map your project root in host to relative dir in guest - Hit OK -
Im0rtality revised this gist
Mar 22, 2014 . 2 changed files with 15 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,2 +1,15 @@ In guest: 1. Create file `/usr/bin/debug` with contents added below (file `debug` below) 2. Make it executable `$ sudo chmod 0777 /usr/bin/debug` In host: 1. Go to PHPStorm `Settings > Project settings > PHP > Servers` 2. Add server with following parameters: - Name: `vagrant` (same as `serverName=` in `debug` script) - Host, port: set vagrant box IP and port - Debugger: Xdebug - [+] Use path mappings - Map your project root in host to relative dir in guest - Hit OK This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,2 +1,2 @@ #!/bin/sh env PHP_IDE_CONFIG="serverName=vagrant" XDEBUG_CONFIG="idekey=PHPSTORM" SYMFONY_DEBUG="1" $@ -
Im0rtality revised this gist
Mar 22, 2014 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1 +1,2 @@ In guest: 1. Create file `/usr/bin/debug` with contents -
Im0rtality created this gist
Mar 22, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ a This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,2 @@ #!/bin/sh env PHP_IDE_CONFIG="serverName=tsp" XDEBUG_CONFIG="idekey=PHPSTORM" SYMFONY_DEBUG="1" $@