ARTICLE AD BOX
Just discoverd the build in browser in VSCode. It would be awesome to debug PHP code as well. But how to set the XDEBUG_SESSION cookie in the build in browser sessions?
My compose.yaml:
name: ${project} volumes: db: networks: default: name: ${project} driver: bridge services: db: image: mariadb container_name: ${project}-db environment: MYSQL_RANDOM_ROOT_PASSWORD: '1' MYSQL_DATABASE: wordpress MYSQL_USER: wordpress MYSQL_PASSWORD: wordpress volumes: - db:/var/lib/mysql wp: build: ./ container_name: ${project}-wp depends_on: - db environment: WORDPRESS_DB_HOST: db WORDPRESS_DB_USER: wordpress WORDPRESS_DB_PASSWORD: wordpress WORDPRESS_DB_NAME: wordpress volumes: - ./app:/var/www/html/wp-content - ./xdebug.ini:/usr/local/etc/php/conf.d/xdebug.ini - ./logs:/var/log ports: - 8080:80and Dockerfile:
# Source image FROM wordpress:6.9.4-php8.4-apache ARG UPLOADS_INI="/usr/local/etc/php/conf.d/uploads.ini" # Install AND configure Xdebug RUN pecl install xdebug \ && docker-php-ext-enable xdebug \ && echo "upload_max_filesize = 128M" > ${UPLOADS_INI} \ && echo "post_max_size = 128M" >> ${UPLOADS_INI}and xdebug.ini:
xdebug.mode = debug # Make sure to restart the container after editing this file xdebug.start_with_request=yes xdebug.client_host = host.docker.internal xdebug.discover_client_host=On xdebug.log_level = 0 xdebug.log = /var/log/xdebug.log xdebug.output_dir = /var/log/xdebug