A Modern XAMPP Alternative - Complete PHP Development Environment
Built with ❤️ by Wylou | PT. Lunexia Tech Horizon
PHP Docker Service is a production-ready Docker Compose setup that provides a complete PHP development environment, similar to XAMPP but with modern containerization benefits. It includes Apache, PHP 8.3, MySQL 8.0, and phpMyAdmin - everything you need for PHP development in one command.
- 🚀 One-Command Setup - Get started in seconds, not minutes
- 🔄 Auto-Reload - Changes reflect immediately without manual refresh
- 🐳 Docker-Based - Consistent environment across all machines
- ⚡ Production-Ready - Optimized for both development and production
- 🎨 Framework Support - Works with Laravel, CodeIgniter, Symfony, and more
- 🔧 Fully Configurable - Customize PHP, Apache, and MySQL settings easily
- 📦 Pre-Installed Extensions - 20+ PHP extensions ready to use
- 🔒 Isolated Environment - No conflicts with system PHP/MySQL
- ✅ PHP 8.3 with Apache (mod_php)
- ✅ MySQL 8.0 with persistent data storage
- ✅ phpMyAdmin for database management
- ✅ Composer pre-installed for dependency management
- 🔄 Auto-Reload - JavaScript-based auto-refresh on file changes
- ⏱️ Extended Timeouts - 10 minutes for long-running scripts
- 💾 Large File Support - 256MB upload limit, 512MB memory
- 🎯 Hot Reload - Changes reflect immediately (no restart needed)
- 📝 Error Display - Development-friendly error reporting
Pre-installed and ready to use:
- Database:
pdo,pdo_mysql,mysqli - Image Processing:
gd(with WebP, JPEG, PNG support) - String Handling:
mbstring,xml,xsl - Compression:
zip,bz2 - Math:
bcmath,gmp - Caching:
opcache,redis,apcu - Internationalization:
intl - And many more...
- ✅ Laravel (full support)
- ✅ CodeIgniter
- ✅ Symfony
- ✅ Slim Framework
- ✅ Any PHP framework or vanilla PHP
- ✅ CSS/SCSS support
- ✅ JavaScript/jQuery
- ✅ Tailwind CSS
- ✅ Vue.js, React, Alpine.js
- ✅ Bootstrap, Bulma, and other CSS frameworks
- Docker 20.10+
- Docker Compose 2.0+
-
Clone the repository
git clone https://github.com/wylou/php-service.git cd php-service -
Configure environment (optional)
cp .env.example .env # Edit .env to customize ports and credentials -
Start the services
docker-compose up -d --build
-
Access your services
- 🌐 Web Application: http://localhost:8080
- 🗃️ phpMyAdmin: http://localhost:8888
- 💾 MySQL:
localhost:3306
That's it! Your PHP development environment is ready. 🎉
php-service/
├── docker/
│ ├── apache/
│ │ └── vhost.conf # Apache virtual host configuration
│ ├── mysql/
│ │ └── init/ # SQL initialization scripts
│ └── php/
│ ├── Dockerfile # Custom PHP 8.3 image
│ └── php.ini # PHP configuration
├── logs/ # Apache & MySQL logs
├── www/ # 📂 Your PHP files go here!
│ ├── index.php # Welcome page
│ ├── _auto-reload.js # Auto-reload script
│ └── demo/ # Demo files
├── .env # Environment variables
├── .env.example # Example environment file
├── docker-compose.yml # Docker Compose configuration
└── README.md # This file
Create a file in www/ folder:
<?php
echo "Hello from PHP Docker Service!";
phpinfo();
?>Access at: http://localhost:8080/your-file.php
# Enter container
docker exec -it php-apache bash
# Create Laravel project
composer create-project laravel/laravel my-app
# Set permissions
chown -R www-data:www-data my-app
chmod -R 755 my-app/storageAccess at: http://localhost:8080/my-app/public/
<?php
$host = 'mysql'; // Use container name
$dbname = 'app_db';
$user = 'developer';
$pass = 'developer123';
$pdo = new PDO("mysql:host=$host;dbname=$dbname", $user, $pass);
echo "Connected successfully!";
?>Include in your HTML:
<script src="/_auto-reload.js"></script>Changes will auto-refresh in the browser! 🔄
Edit .env file to customize:
# Web Server Ports
WEB_PORT=8080
WEB_PORT_ALT=8081
# MySQL Configuration
MYSQL_PORT=3306
MYSQL_ROOT_PASSWORD=your_secure_password
MYSQL_DATABASE=app_db
MYSQL_USER=developer
MYSQL_PASSWORD=your_password
# phpMyAdmin
PMA_PORT=8888Edit docker/php/php.ini to customize PHP settings:
max_execution_time = 600(10 minutes)memory_limit = 512Mupload_max_filesize = 256Mpost_max_size = 512M
Edit docker/apache/vhost.conf for Apache settings.
# Start services
docker-compose up -d
# Stop services
docker-compose down
# View logs
docker-compose logs -f
# Restart a service
docker-compose restart web
# Enter PHP container
docker exec -it php-apache bash
# Run Composer
docker exec -it php-apache composer install
# Check service status
docker-compose ps- 📖 Live Reload Guide - Auto-reload setup
- 🎨 Frameworks Guide - CSS, JS, frameworks support
- 🚀 Laravel Setup - Laravel installation guide
- 🔄 Auto-Reload Setup - Auto-refresh configuration
Check out the demo page to see CSS, Tailwind, and jQuery in action:
Demo: http://localhost:8080/demo/css-demo.php
Change ports in .env:
WEB_PORT=8082
PMA_PORT=8890sudo chown -R $(whoami):$(whoami) www/Wait for MySQL to fully start:
docker-compose logs mysql- Hard refresh browser:
Ctrl + F5(Windows/Linux) orCmd + Shift + R(Mac) - Clear OPcache:
docker exec php-apache php -r "opcache_reset();" - Restart web service:
docker-compose restart web
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Wylou
- GitHub: @wylouuu
- Email: lojokowilly.dev@gmail.com
PT. Lunexia Tech Horizon
- Website: https://lunexia.id
- Building innovative tech solutions
- PHP Community for amazing tools
- Docker team for containerization
- All contributors and users of this project
If this project helped you, please give it a ⭐ on GitHub!
Made with ❤️ by Wylou | PT. Lunexia Tech Horizon