What does this repository offer?
- A fully debuggable WordPress docker instance
- Limit of upload_max_filesize increased to upload plugins with high filesize
git clone https://github.com/dhakalananda/wp-xdebug-docker
cd wp-xdebug-docker
docker-compose up -d
- Navigate to http://localhost:8000 and set up WordPress
XDebug is listening on port 9000. Use your preferred IDE to attach to the listener.
- Remove the line
- ./wp:/var/www/html
from thedocker-compose.yaml
file
For some Mac devices, using the docker-compose might install AMD version so:
git clone https://github.com/Automattic/wordpress-xdebug
cd wordpress-xdebug
docker build -t wp-debug:latest .
cd
git clone https://github.com/dhakalananda/wp-xdebug-docker
cd wp-xdebug-docker
- Replace the
image: automattic/wordpress-xdebug:latest
withimage: wp-debug:latest
in the docker-compose.yaml file docker-compose up -d
- Navigate to http://localhost:8000 and set up WordPress
- Install Dev Container & PHP Debug VSCode plugin
- Use the Connect to option and Attach to running container
- Select the WordPress container
- Create a launch.json file and attach to 9000 port
Example launch.json file:
{
"version": "0.2.0",
"configurations": [
{
"name": "Listen for Xdebug",
"type": "php",
"request": "launch",
"port": 9000
}
]
}
For more info: https://code.visualstudio.com/docs/devcontainers/attach-container
This repo makes use of https://github.com/Automattic/wordpress-xdebug image
No XDebug here!!
docker network create wp-network
docker run -d --name wp-mariadb \
--network wp-network \
-e MYSQL_ROOT_PASSWORD=root \
-e MYSQL_DATABASE=wordpress \
-e MYSQL_USER=wp_user \
-e MYSQL_PASSWORD=wp_pass \
mariadb:latest
docker run -d --name oldwp \
--network wp-network \
-p 4444:80 \
-e WORDPRESS_DB_HOST=wp-mariadb \
-e WORDPRESS_DB_USER=wp_user \
-e WORDPRESS_DB_PASSWORD=wp_pass \
-e WORDPRESS_DB_NAME=wordpress \
wordpress:5.6
To exceed the file upload limit, add the below lines in the .htaccess
file.
php_value upload_max_filesize 500M
php_value post_max_size 500M