This is a basic LAMP stack environment with XDebug built using Docker Compose. It consists following:
- PHP 7.2
- Apache (mod_php)
- MariaDB
bin
- container Dockerfilesphp-apache
config
- container service configurationsapache2
- Apache virtual hostsphp
- PHP config directory
logs
- log directoryapache2
- Apache log directory. There can be PHP logs also.xdebug
- XDebug log directorymysql
- MySQL log directory
www
- project source code
- Make sure you have installed Docker
- Clone the repository
git clone https://github.com/blry/docker-compose-lamp-xdebug.git
- Rename
.env.example
to.env
and configureFULL_ROOT_DIR
- full path to the repository. Don't use relative paths and:
symbol./c/Users/alexander.sterpu/Desktop/docker-compose-lamp-xdebug/
(path on Windows)/repos/docker-compose-lamp-xdebug/
(path on Linux / Mac)
HTTP_PORT
- bind Apache HTTP Server to the port on host machineMYSQL-*
- MySQL settings
APACHE_VHOSTS_DIR
- path to Apache virtual hosts directoryPHP_INI
- path to php.ini fileXDEBUG_REMOTE_PORT
- XDebug remote port. Must not be occupied.XDEBUG_IDE_KEY
- XDebug IDE Key optionAPACHE_LOG_DIR
- path to the Apache log directory. There can be PHP logs also.MYSQL_LOG_DIR
- path to the MySQL (MariaDB) log directoryXDEBUG_LOG_DIR
- path to the XDebug log directory
- If you use Docker for Windows, configure Docker Shared Drives
- Run
docker-compose up -d
(-d
runs container in the background) - Done! Now you can access the website via
http://localhost:${HTTP_PORT}