PHP 8.3 + Apache container with MySQL/MariaDB and MS SQL Server support. Designed for offline/air-gapped environments.
- PHP 8.3
- Apache web server
mysqliextension (MySQL/MariaDB)pdo+pdo_mysqlextensionssqlsrv+pdo_sqlsrvextensions (MS SQL Server)msodbcsql18ODBC drivermod_rewriteenabled
docker compose up -d --buildAccess: http://localhost:8089
# Build and export image
docker build -t php-apache-mysql .
docker save php-apache-mysql -o php-apache-mysql.tar# 1. Copy php-apache-mysql.tar and this project to the offline PC
# 2. Load image
docker load -i php-apache-mysql.tar
# 3. Put your PHP files in html/ folder
cp your-api.php html/
# 4. Start
docker compose up -d
# 5. Access
# http://PC-IP:8089/your-api.phpEdit docker-compose.yml, change 8089:80 to your preferred port.
Put all PHP files in the html/ folder. They are mounted into the container at /var/www/html.
$conn = new mysqli("DB_HOST", "DB_USER", "DB_PASS", "DB_NAME");$conn = sqlsrv_connect("DB_HOST", [
"Database" => "DB_NAME",
"UID" => "DB_USER",
"PWD" => "DB_PASS"
]);- If database is on the same machine: use the host machine's IP (not
localhost) - If database is in another Docker container on the same network: use the container name
Download php-apache-mysql.tar from Releases — no internet needed on the target PC.
MIT