Last active
          August 21, 2020 02:48 
        
      - 
      
 - 
        
Save nstapelbroek/0ef92d2201facd8b2aca01925e3c1747 to your computer and use it in GitHub Desktop.  
  
    
      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 characters
    
  
  
    
  | docker exec -ti \ | |
| -e PHP_IDE_CONFIG="serverName=local.project.cli" \ | |
| -e XDEBUG_CONFIG="idekey=PHPSTORM" \ | |
| my_container php /app/index.php | 
  
    
      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 characters
    
  
  
    
  | docker-compose exec my_container php /app/index.php | 
  
    
      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 characters
    
  
  
    
  | networks: | |
| default: | |
| driver: bridge | |
| ipam: | |
| driver: default | |
| config: | |
| - subnet: 192.168.xx.0/24 | |
| gateway: 192.168.xx.1 | 
  
    
      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 characters
    
  
  
    
  | services: | |
| my_container: | |
| environment: | |
| PHP_IDE_CONFIG: serverName=local.project.cli | |
| XDEBUG_CONFIG: idekey=PHPSTORM | 
  
    
      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 characters
    
  
  
    
  | docker network inspect my_network | grep GateWay | 
  
    
      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 characters
    
  
  
    
  | docker inspect my_container | grep NetworkMode | 
  
    
      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 characters
    
  
  
    
  | { | |
| "version": "0.2.0", | |
| "configurations": [ | |
| { | |
| "name": "Listen for XDebug", | |
| "type": "php", | |
| "request": "launch", | |
| "port": 9000, | |
| "serverSourceRoot": "/var/www/myproject", | |
| "localSourceRoot": "/home/nico/Projects/myproject" | |
| }, | |
| { | |
| "name": "Launch currently open script", | |
| "type": "php", | |
| "request": "launch", | |
| "program": "${file}", | |
| "cwd": "${fileDirname}", | |
| "port": 9000 | |
| } | |
| ] | |
| } | 
  
    
      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 characters
    
  
  
    
  | vagrant ssh -c "XDEBUG_CONFIG=\"idekey=PHPSTORM\" PHP_IDE_CONFIG=\"serverName=local.myproject.cli\" /vagrant/app/console my-app:my-command" | 
  
    
      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 characters
    
  
  
    
  | config.vm.network 'private_network', ip: '192.168.56.100' | 
  
    
      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 characters
    
  
  
    
  | php-xdebug: | |
| pkg.installed | |
| /etc/php/7.1/fpm/conf.d/20-xdebug.ini: | |
| file.managed: | |
| - contents: | | |
| zend_extension=xdebug.so | |
| xdebug.remote_connect_back=0 | |
| xdebug.remote_host=192.168.56.1 | |
| xdebug.remote_enable=1 | |
| xdebug.remote_port=9000 | |
| - require: | |
| - pkg: php-xdebug | 
  
    
      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 characters
    
  
  
    
  | zend_extension=xdebug.so | |
| xdebug.remote_enable=1 | |
| xdebug.remote_connect_back=0 | |
| xdebug.remote_host=<gateway_ip> | |
| xdebug.remote_port=9000 | 
  
    
      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 characters
    
  
  
    
  | zend_extension=xdebug.so | |
| xdebug.remote_enable=1 | |
| xdebug.remote_connect_back=0 | |
| xdebug.remote_host=docker.for.mac.localhost | |
| xdebug.remote_port=9000 | 
  
    
      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 characters
    
  
  
    
  | zend_extension=xdebug.so | |
| xdebug.remote_enable=1 | |
| xdebug.remote_connect_back=0 | |
| xdebug.remote_host=docker.for.win.localhost | |
| xdebug.remote_port=9000 | 
  
    
      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 characters
    
  
  
    
  | zend_extension=xdebug.so | |
| xdebug.remote_enable=1 | |
| xdebug.remote_connect_back=0 | |
| xdebug.remote_host=127.0.0.1 | |
| xdebug.remote_port=9000 | 
  
    
      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 characters
    
  
  
    
  | zend_extension=xdebug.so | |
| xdebug.remote_enable=1 | |
| xdebug.remote_connect_back=0 | |
| xdebug.remote_host=192.168.56.1 | |
| xdebug.remote_port=9000 | 
  
    
      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 characters
    
  
  
    
  | vagrant ssh -c "sudo apt install php-xdebug && printf 'zend_extension=xdebug.so\nxdebug.remote_connect_back=0\nxdebug.remote_host=192.168.56.1\nxdebug.remote_enable=1\nxdebug.remote_port=9000\n' | sudo tee /etc/php/*/mods-available/xdebug.ini && sudo phpenmod xdebug" | 
  
    
      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 characters
    
  
  
    
  | vagrant ssh -c "php -i | grep 'xdebug'" | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment