Repository: https://github.com/Eetezadi/Gitpod-Apache-PHP-Xdebug (can be run in GitPod)
.gitpod.yml
image:
file: .gitpod.dockerfile
context: apache
ports:
- port: 8080
onOpen: open-preview
- port: 9003
onOpen: ignore
tasks:
- name: Apache
command: >
apachectl start &&
multitail /var/log/apache2/access.log -I /var/log/apache2/error.log
vscode:
extensions:
- felixfbecker.php-debug
.gitpod.Dockerfile:
FROM gitpod/workspace-full:latest
# install corresponding PHP Xdebug
RUN sudo install-packages php-xdebug
# Copy the Xdebug configuration into the container
COPY xdebug.ini /etc/php/8.2/cli/conf.d/20-xdebug.ini
# optional: use a custom apache config.
COPY apache.conf /etc/apache2/apache2.conf
# optional: change document root folder. It's relative to your git working copy.
ENV APACHE_DOCROOT_IN_REPO="www"
xdebug.ini:
zend_extension = xdebug
xdebug.mode = debug
xdebug.start_with_request = yes
xdebug.client_host = host.docker.internal
xdebug.log = ${GITPOD_REPO_ROOT}/xdebug.log
This is the launch.json
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Listen for Xdebug",
"type": "php",
"request": "launch",
"port": 9003,
},
{
"name": "Launch currently open script",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 0,
"runtimeArgs": [
"-dxdebug.start_with_request=yes"
],
"env": {
"XDEBUG_MODE": "debug,develop",
"XDEBUG_CONFIG": "client_port=${port}"
}
}
]
}
Repository: https://github.com/Eetezadi/Gitpod-Apache-PHP-Xdebug (can be run in GitPod)
.gitpod.yml
image:
file: .gitpod.dockerfile
context: apache
ports:
- port: 8080
onOpen: open-preview
- port: 9003
onOpen: ignore
tasks:
- name: Apache
command: >
apachectl start &&
multitail /var/log/apache2/access.log -I /var/log/apache2/error.log
vscode:
extensions:
- felixfbecker.php-debug
.gitpod.Dockerfile:
FROM gitpod/workspace-full:latest
# install corresponding PHP Xdebug
RUN sudo install-packages php-xdebug
# Copy the Xdebug configuration into the container
COPY xdebug.ini /etc/php/8.2/cli/conf.d/20-xdebug.ini
# optional: use a custom apache config.
COPY apache.conf /etc/apache2/apache2.conf
# optional: change document root folder. It's relative to your git working copy.
ENV APACHE_DOCROOT_IN_REPO="www"
xdebug.ini:
zend_extension = xdebug
xdebug.mode = debug
xdebug.start_with_request = yes
xdebug.client_host = host.docker.internal
xdebug.log = ${GITPOD_REPO_ROOT}/xdebug.log
This is the launch.json
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Listen for Xdebug",
"type": "php",
"request": "launch",
"port": 9003,
},
{
"name": "Launch currently open script",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 0,
"runtimeArgs": [
"-dxdebug.start_with_request=yes"
],
"env": {
"XDEBUG_MODE": "debug,develop",
"XDEBUG_CONFIG": "client_port=${port}"
}
}
]
}
Repository: https://github.com/Eetezadi/Gitpod-Apache-PHP-Xdebug (can be run in GitPod)
.gitpod.yml
.gitpod.yml
Repository: https://github.com/Eetezadi/Gitpod-Apache-PHP-Xdebug (can be run in GitPod)
.gitpod.yml
The challenge is to connect Xdebug to the webserverdebug client. That seems to fail if one is just using "localhost". I also wonder if some settings in the launchxdebug.jsonclient_host = localhost, because of VSCode are necessary or maybe some port access in the Docker environment. Normally one would use gitpodxdebug.ymlclient_host = host.docker.internal?, but simply declaring that does not work on GitPod.
zend_extension = xdebug
xdebug.mode = debug
xdebug.start_with_request = yes
xdebug.client_host = localhosthost.docker.internal
xdebug.log = ${GITPOD_REPO_ROOT}/xdebug.log
The challenge is to connect Xdebug to the webserver. That seems to fail if one is just using "localhost". I also wonder if some settings in the launch.json of VSCode are necessary or maybe some port access in the gitpod.yml?
zend_extension = xdebug
xdebug.mode = debug
xdebug.start_with_request = yes
xdebug.client_host = localhost
xdebug.log = ${GITPOD_REPO_ROOT}/xdebug.log
The challenge is to connect Xdebug to the debug client. That seems to fail if one is just using xdebug.client_host = localhost, because of the Docker environment. Normally one would use xdebug.client_host = host.docker.internal, but simply declaring that does not work on GitPod.
zend_extension = xdebug
xdebug.mode = debug
xdebug.start_with_request = yes
xdebug.client_host = host.docker.internal
xdebug.log = ${GITPOD_REPO_ROOT}/xdebug.log
- 166.8k
- 49
- 420
- 422