Closed jajajaime closed 2 years ago
@jajajaime sorry you're having this issue. In addition to the debug info you've already provided, with XDEBUG_ENABLED="1"
(looks like it already is above) active in the container, can you you also provide the output for:
fin exec php -i | egrep "[Xx]debug"
fin exec env
(with sensitive information removed)In addition, can you provide the:
@lpeabody sure thing! Thanks for getting back on this issue.
PhpStorm settings Added server with:
Thank you for including that. I think I see the issue, or at least part of it. Can you add the following to docksal.yml
and then run fin up
:
services:
cli:
environment:
- "XDEBUG_MODE=debug"
Let me know how that works. For reference https://xdebug.org/docs/all_settings#mode. In the latest released version of service/cli
(3.0), we configured xdebug.mode=debug
to be set OOTB in that image, but in service/cli
versions 2.12+ Xdebug was accidentally upgraded during the builds for those images, and the debug mode was not properly set.
EDIT: If you can I would also recommend updating your cli service to use the latest version, docksal/cli:php7.4-3.0
, which would also likely resolve this issue (i.e. you would not need to set XDEBUG_MODE
in docksal.yml).
Sadly, setting that environment variable (with and without the quotes) still renders
xdebug.mode => develop => develop
when I view the php -i
info, and Xdebug does not trigger on breakpoints.
What's the real difference between using docksal/cli:2.13-php7.4
vs docksal/cli:php7.4-3.0
?
@jajajaime php -i
is just going to output the configuration in the ini file, that won't show overridden values from environment variables, so that is to be expected. The difference in cli versions is Xdebug configuration as brought up to speed in the 3.0 https://github.com/docksal/service-cli/blob/v3.0.0/7.4/config/php/xdebug.ini (includes setting debug mode and client port setting, both were added in Xdebug 3.).
Can you try using service/cli:php7.4-3.0
to see if that gets Xdebug to trigger? I'm just trying to narrow down the problem.
Likely related https://github.com/docksal/service-cli/issues/212
@lpeabody I tried docksal/cli:php7.4-3.0
but same result. Xdebug does not trigger.
@jajajaime On your system, can you create a brand new Docksal PHP project and configure it in PHPStorm so that it stops at a breakpoint?
@lpeabody That worked. I used the Laravel boilerplate and set the docksal/cli:php7.4-3.0
image, and it breaks at breakpoints. I wonder what's different in my Magento project.
Okay great. In your original project, can you try resetting both the cli
and web
services and see if that helps? Via fin reset ...
Hey @jajajaime wanted to check in and see if you were still running into issue
I'm sorry but I haven't tried since. I am now running a Mac M1 and using docksal/cli:php7.4-3.0
for compatibility. I don't think the older one from this original issue will run smoothly here.
Ok. Thank you for letting us know. Let us know if you run into any other issues and we can open a new ticket.
When attempting to use Xdebug with the docksal/cli:2.13-php7.4 image, nothing happens and breakpoints do not trigger on PhpStorm (at least on a Magento 2.4.2 installation.)
Switching to docksal/cli:2.11-php7.4 makes Xdebug breakpoint trigger without any issues.
Steps to reproduce the issue:
Describe the results you received:
Xdebug did not trigger anywhere and pages load normally.
Describe the results you expected:
Xdebug to trigger on breakpoints.
Output of
fin config
:fin config output
``` --------------------- COMPOSE_PROJECT_NAME_SAFE: myproject COMPOSE_FILE: /Users/jaime/.docksal/stacks/volumes-none.yml /Users/jaime/.docksal/stacks/stack-default.yml /Users/jaime/projects/myproject/.docksal/docksal.yml /Users/jaime/projects/myproject/.docksal/docksal-local.yml ENV_FILE: /Users/jaime/projects/myproject/.docksal/docksal.env /Users/jaime/projects/myproject/.docksal/docksal-local.env PROJECT_ROOT: /Users/jaime/projects/myproject DOCROOT: www VIRTUAL_HOST: myproject.docksal VIRTUAL_HOST_ALIASES: *.myproject.docksal IP: 192.168.64.100 MYSQL: 192.168.64.100:33113 Docker Compose configuration --------------------- services: cli: dns: - 192.168.64.100 - 8.8.8.8 environment: BLACKFIRE_CLIENT_ID: null BLACKFIRE_CLIENT_TOKEN: null COMPOSER_ALLOW_XDEBUG: '1' COMPOSER_DEFAULT_VERSION: '2' COMPOSER_DISABLE_XDEBUG_WARN: '1' DOCROOT: www DRUSH_ALLOW_XDEBUG: '1' DRUSH_OPTIONS_URI: myproject.docksal GIT_USER_EMAIL: jaimelopezav@gmail.com GIT_USER_NAME: Jaime HOST_GID: '20' HOST_UID: '501' MYSQL_DATABASE: default MYSQL_HOST: db MYSQL_PASSWORD: user MYSQL_ROOT_PASSWORD: root MYSQL_USER: user PHP_IDE_CONFIG: serverName=myproject.docksal SECRET_ACAPI_EMAIL: null SECRET_ACAPI_KEY: null SECRET_ACQUIACLI_KEY: null SECRET_ACQUIACLI_SECRET: null SECRET_PLATFORMSH_CLI_TOKEN: null SECRET_SSH_PRIVATE_KEY: null SECRET_TERMINUS_TOKEN: null SSH_AUTH_SOCK: /.ssh-agent/proxy-socket VIRTUAL_HOST: myproject.docksal XDEBUG_CONFIG: client_host=192.168.64.1 remote_host=192.168.64.1 XDEBUG_ENABLED: '1' healthcheck: interval: 10s hostname: cli image: docksal/cli:2.13-php7.4 labels: io.docksal.shell: bash io.docksal.user: docker logging: options: max-file: '10' max-size: 1m volumes: - docksal_ssh_agent:/.ssh-agent:ro - cli_home:/home/docker:rw - /tmp/.docksal/myproject:/tmp/.docksal/myproject:ro - project_root:/var/www:rw,nocopy,cached db: dns: - 192.168.64.100 - 8.8.8.8 environment: MYSQL_ALLOW_EMPTY_PASSWORD: null MYSQL_DATABASE: default MYSQL_INITDB_SKIP_TZINFO: null MYSQL_ONETIME_PASSWORD: null MYSQL_PASSWORD: user MYSQL_RANDOM_ROOT_PASSWORD: null MYSQL_ROOT_PASSWORD: root MYSQL_USER: user healthcheck: interval: 10s hostname: db image: docksal/mariadb:10.4 logging: options: max-file: '10' max-size: 1m ports: - published: 33113 target: 3306 volumes: - db_data:/var/lib/mysql:rw - project_root:/var/www:ro,nocopy,cached elasticsearch: dns: - 192.168.64.100 - 8.8.8.8 - 192.168.64.100 - 8.8.8.8 entrypoint: /usr/share/elasticsearch/docksal/entrypoints/elasticsearch.sh environment: ES_JAVA_OPTS: -Xms512m -Xmx512m bootstrap.memory_lock: "true" discovery.type: single-node hostname: elasticsearch image: elasticsearch:7.9.3 ports: - target: 9200 ulimits: memlock: hard: -1 soft: -1 volumes: - /Users/jaime/projects/myproject/.docksal:/usr/share/elasticsearch/docksal:rw mail: dns: - 192.168.64.100 - 8.8.8.8 healthcheck: interval: 10s hostname: mail image: mailhog/mailhog labels: io.docksal.cert-name: none io.docksal.virtual-host: mail.myproject.docksal,mail.myproject.docksal.* io.docksal.virtual-port: '8025' logging: options: max-file: '10' max-size: 1m volumes: - project_root:/var/www:ro,nocopy,cached web: depends_on: cli: condition: service_started dns: - 192.168.64.100 - 8.8.8.8 environment: APACHE_BASIC_AUTH_PASS: null APACHE_BASIC_AUTH_USER: null APACHE_DOCUMENTROOT: /var/www/www APACHE_FCGI_HOST_PORT: cli:9000 healthcheck: interval: 10s hostname: web image: docksal/apache:2.4-2.3 labels: io.docksal.cert-name: none io.docksal.permanent: "false" io.docksal.project-root: /Users/jaime/projects/myproject io.docksal.virtual-host: myproject.docksal,*.myproject.docksal,myproject.docksal.* logging: options: max-file: '10' max-size: 1m volumes: - project_root:/var/www:ro,nocopy,cached version: '2.1' volumes: cli_home: {} db_data: {} docksal_ssh_agent: external: true name: docksal_ssh_agent project_root: {} --------------------- ```Output of
fin sysinfo
:fin sysinfo output
``` βββ FIN fin version: 1.106.0 βββ OS Darwin macOS 11.4 Darwin Macbearth.localdomain 20.5.0 Darwin Kernel Version 20.5.0: Sat May 8 05:10:33 PDT 2021; root:xnu-7195.121.3~9/RELEASE_X86_64 x86_64 βββ ENVIRONMENT MODE : Docker Desktop DOCKER_HOST : βββ NFS DOCKSAL_NFS_PATH : /Volumes/dev/ nfsd service is enabled nfsd is running (pid 236, 8 threads) NFS EXPORTS ---------- #