Download the PHP package jlucki/docker-php-dev-env without Composer
On this page you can find all versions of the php package jlucki/docker-php-dev-env. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jlucki/docker-php-dev-env
More information about jlucki/docker-php-dev-env
Files in jlucki/docker-php-dev-env
Package docker-php-dev-env
Short Description A simple web development environment using Docker with NGINX, PHP, MySQL and Xdebug.
License MIT
Informations about the package docker-php-dev-env
Docker PHP Development Environment
This repository allows you to quickly get a development environment up and running using Docker, including a MySQL database and some debugging tools.
This environment includes the latest versions of the following software:
nginx:alpinephp:8.5-fpmmysql:latestxdebug
Prerequisites
- Docker (https://www.docker.com/products/docker-desktop)
- Tested on macOS 15.7.1 (Sequoia) and Windows 10 Version 10.0.18362
- Windows 10 requires Docker File Sharing with the C drive to be enabled in the Docker settings, restart may be required after enabling sharing
Project Setup
Run composer create-project jlucki/docker-php-dev-env "project_name"
Alternatively, download the files from this repo and copy them to your project directory.
Running the Container
- Run
docker compose up -dfrom the project directory- The above command will only work on versions newer than 3.6. If you are using Docker 3.6 or older, use
docker-compose up -d - You can check running containers withg
docker ps
- The above command will only work on versions newer than 3.6. If you are using Docker 3.6 or older, use
- Visit
localhostin your browser
Setting up Xdebug in Your IDE
The following instructions are for PHPStorm.
- Click on Run > Edit Configurations
- Click the
+and add a new PHP Remote Debug configuration - Give the configuration a name
- Tick Filter debug connection by IDE key
- Add
PHPSTORMin the session id - Click the
...next to Server - Click the
+to add a new server - Give the server a name, and set the host to
localhost - Tick Use path mappings
- Under the
Project filesfile/directory, next to your project folder, for theAbsolute path on the servercolumn add/var/www/html - Hit Apply and OK until you've returned to the IDE
- Click the Start Listening for PHP Debug Connections icon
- Set a breakpoint in your code
- Refresh the page in your browser
- Accept Incoming Connection From Xdebug
- Happy debugging!
See https://xdebug.org/docs/remote for how to enable xdebug sessions.
Additional Notes
For database connections, use mysql as the hostname. If you would like a different hostname, change the service name in the docker-compose.yml file.
Windows 10 Troubleshooting
For troubleshooting tips see the wiki.