Configuration

PHP version

Set the version in .env:

PHP_VERSION=8.4

Available: 7.4, 8.0, 8.1, 8.2, 8.3, 8.4

Rebuild after changing:

docker compose build apache
docker compose up -d

PHP extensions

Installed by default: mysql, bcmath, curl, imagick, gd, xml, mbstring, zip.

To add more, edit apache/Dockerfile and add to the apt-get install line:

php${PHP_VERSION}-redis \
php${PHP_VERSION}-intl \

Custom php.ini

Edit apache/php.ini to change PHP settings (upload limits, memory, error reporting, etc.). Rebuild after changes.

MariaDB

Set the version and root password in .env:

MARIADB_VERSION=11.4
MARIADB_ROOT_PASSWORD=your-password

Connect from your host:

mysql -h 127.0.0.1 -P 3306 -u root -p

Connect from PHP inside the container — use the service name database as the host:

$pdo = new PDO('mysql:host=database;port=3306;dbname=mydb', 'root', 'your-password');

Virtual hosts

Apache uses mod_vhost_alias with VirtualDocumentRoot /var/www/%0. Each subdirectory in /var/www/ automatically maps to a .localhost domain:

Directory URL
/var/www/mysite/ http://mysite.localhost/
/var/www/blog/ http://blog.localhost/

The config is in apache/000-default.conf. .htaccess files are supported (AllowOverride All).

SSL / HTTPS

Self-signed certificates are included in apache/ssl/. HTTPS works at https://your-project.localhost/ — your browser will show a certificate warning (expected for self-signed certs).

To use your own certificates, replace the files in apache/ssl/ and rebuild.

DNS

dnsmasq routes *.localhost to 127.0.0.1. The config is in dnsmasq/dnsmasq.conf. It runs on port 53535 to avoid conflicts with the host’s port 53.