Code Monkey home page Code Monkey logo

Comments (9)

jaouadk avatar jaouadk commented on July 17, 2024

You shouldn't have any issues connecting phpStorm to xdebug: all you need to do is expose port 9000 in your docker-compose.yml file under the ports section 9000:9000

Haven't tested it but should work.

from homestead-docker.

digitalit avatar digitalit commented on July 17, 2024

Is it okay if i post pictures of all my settings so you can review those and maybe see what im doing wrong in order to get the debug working or do you what them on email and the we can post the solution here for others to see?

from homestead-docker.

jaouadk avatar jaouadk commented on July 17, 2024

I don't use PhpStorm, but, I'll do my best.

from homestead-docker.

digitalit avatar digitalit commented on July 17, 2024

great,

  expose:
        - "9000"
    ports:
        - "8080:80" # web
        - "2222:22" # ssh
        - "9000:9000" # xDebug
        - "35729:35729" # live reload
        - "9876:9876" # karma server

gives me: ERROR: for web Cannot start service web: driver failed programming external connectivity on endpoint dc_web_1 (6120a4d737b94d575a2c97d08bfb296bfb9fb81e4695393820ddee75ad24f833): Error starting userland proxy: Bind for 0.0.0.0:9000 failed: port is already allocated
ERROR: Encountered errors while bringing up the project.

from homestead-docker.

digitalit avatar digitalit commented on July 17, 2024

No errors now bu still no debug triggering in phpStorm:

In provision.sh

# Enable Remote xdebug
echo "xdebug.idekey = PHPSTORM" >> /etc/php/7.0/fpm/conf.d/20-xdebug.ini
echo "xdebug.default_enable = 0" >> /etc/php/7.0/fpm/conf.d/20-xdebug.ini
echo "xdebug.remote_enable = 1" >> /etc/php/7.0/fpm/conf.d/20-xdebug.ini
echo "xdebug.remote_port = 9000" >> /etc/php/7.0/fpm/conf.d/20-xdebug.ini
echo "xdebug.remote_autostart = 0" >> /etc/php/7.0/fpm/conf.d/20-xdebug.ini
echo "xdebug.remote_connect_back = 1" >> /etc/php/7.0/fpm/conf.d/20-xdebug.ini
echo "xdebug.profiler_enable = 0" >> /etc/php/7.0/fpm/conf.d/20-xdebug.ini
echo "xdebug.remote_host = 10.254.254.254" >> /etc/php/7.0/fpm/conf.d/20-xdebug.ini

in docker-compose.yml

 expose:
        - "9000"
    ports:
        - "8080:80" # web
        - "2222:22" # ssh
        - "35729:35729" # live reload
        - "9876:9876" # karma server
    environment:
        PHP_XDEBUG_ENABLED: 1 # Set 1 to enable.

skarmavbild 2016-09-23 kl 18 11 31

Web server debug validation looks fine in phpstorm

from homestead-docker.

digitalit avatar digitalit commented on July 17, 2024

I get this in Kitematic when startin web container, is this ok?

/usr/lib/python2.7/dist-packages/supervisor/options.py:297: UserWarning: Supervisord is running as root and it is searching for its configuration file in default locations (including its current working directory); you probably want to specify a "-c" argument specifying an absolute path to a configuration file for improved security.
  'Supervisord is running as root and it is searching '
2016-09-23 16:04:19,809 CRIT Supervisor running as root (no user in config file)
2016-09-23 16:04:19,809 WARN Included extra file "/etc/supervisor/conf.d/supervisor.conf" during parsing
2016-09-23 16:04:19,825 INFO RPC interface 'supervisor' initialized
2016-09-23 16:04:19,825 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2016-09-23 16:04:19,825 INFO supervisord started with pid 1
2016-09-23 16:04:20,830 INFO spawned: 'nginx' with pid 8
2016-09-23 16:04:20,831 INFO spawned: 'sshd' with pid 9
2016-09-23 16:04:20,833 INFO spawned: 'php-fpm7.0' with pid 10
2016-09-23 16:04:20,835 INFO spawned: 'redis' with pid 11
2016-09-23 16:04:20,837 INFO spawned: 'beanstalkd' with pid 12
2016-09-23 16:04:21,972 INFO success: nginx entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2016-09-23 16:04:21,973 INFO success: sshd entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2016-09-23 16:04:21,973 INFO success: php-fpm7.0 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2016-09-23 16:04:21,973 INFO success: redis entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2016-09-23 16:04:21,973 INFO success: beanstalkd entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

from homestead-docker.

digitalit avatar digitalit commented on July 17, 2024

I cant figure out why the Crome Debug add on won't trigger debugging in phpstorm.

Maybe someone else is using phpstorm and can explain to me :)

from homestead-docker.

digitalit avatar digitalit commented on July 17, 2024

FINALLY :)

This is how i solved this:

n provision.sh

# Enable Remote xdebug
echo "xdebug.idekey = PHPSTORM" >> /etc/php/7.0/fpm/conf.d/20-xdebug.ini
echo "xdebug.default_enable = 0" >> /etc/php/7.0/fpm/conf.d/20-xdebug.ini
echo "xdebug.remote_enable = 1" >> /etc/php/7.0/fpm/conf.d/20-xdebug.ini
echo "xdebug.remote_autostart = 0" >> /etc/php/7.0/fpm/conf.d/20-xdebug.ini
echo "xdebug.remote_connect_back = 0" >> /etc/php/7.0/fpm/conf.d/20-xdebug.ini
echo "xdebug.profiler_enable = 0" >> /etc/php/7.0/fpm/conf.d/20-xdebug.ini
echo "xdebug.remote_host = 10.254.254.254" >> /etc/php/7.0/fpm/conf.d/20-xdebug.ini

in docker-compose.yml

expose:
        - "9000"
    ports:
        - "8080:80" # web
        - "2222:22" # ssh
        - "35729:35729" # live reload
        - "9876:9876" # karma server
    environment:
        PHP_XDEBUG_ENABLED: 1 # Set 1 to enable.
        XDEBUG_CONFIG: remote_host=10.254.254.254

The IP i used everywhere is for my local mac, the one with phpStorm installed on. The IP is not 10.254.254.254 but since the IP could change i made an alias that points to 127.0.0.1.

For some reason i didn't work with 127.0.0.1, i guess Docker container sees it at it self?

Anyway, to create the alias i did:

sudo ifconfig en0 alias 10.254.254.254 255.255.255.0

in phpStorm i used all default settings but added this:
skarmavbild 2016-09-24 kl 14 10 18

from homestead-docker.

jaouadk avatar jaouadk commented on July 17, 2024

Excellent !

I knew it had something to do with the IP address.

from homestead-docker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.