
A basic LAMP stack environment built using Docker Compose. It consists of the following:
As of now, we have several different PHP versions. Use appropriate php version as needed:
docker compose up -d.git clone https://github.com/sprintcube/docker-compose-lamp.git cd docker-compose-lamp/ cp sample.env .env // modify sample.env as needed docker compose up -d // visit localhost
Your LAMP stack is now ready!! You can access it via http://localhost.
This Docker Stack is build for local development and not for production usage.
This package comes with default configuration options. You can modify them by creating .env file in your root directory.
To make it easy, just copy the content from sample.env file and update the environment variable values as per your need.
There are following configuration variables available and you can customize them by overwritting in your own .env file.
PHPVERSION Is used to specify which PHP Version you want to use. Defaults always to latest PHP Version.
PHP_INI
Define your custom php.ini modification to meet your requirments.
DOCUMENT_ROOT
It is a document root for Apache server. The default value for this is ./www. All your sites will go here and will be synced automatically.
APACHE_DOCUMENT_ROOT
Apache config file value. The default value for this is /var/www/html.
VHOSTS_DIR
This is for virtual hosts. The default value for this is ./config/vhosts. You can place your virtual hosts conf files here.
Make sure you add an entry to your system's
hostsfile for each virtual host.
APACHE_LOG_DIR
This will be used to store Apache logs. The default value for this is ./logs/apache2.
For Apple Silicon Users: Please select Mariadb as Database. Oracle doesn't build their SQL Containers for the arm Architecture
DATABASE
Define which MySQL or MariaDB Version you would like to use.
MYSQL_INITDB_DIR
When a container is started for the first time files in this directory with the extensions .sh, .sql, .sql.gz and
.sql.xz will be executed in alphabetical order. .sh files without file execute permission are sourced rather than executed.
The default value for this is ./config/initdb.
MYSQL_DATA_DIR
This is MySQL data directory. The default value for this is ./data/mysql. All your MySQL data files will be stored here.
MYSQL_LOG_DIR
This will be used to store Apache logs. The default value for this is ./logs/mysql.
Apache is configured to run on port 80. So, you can access it via http://localhost.
By default following modules are enabled.
If you want to enable more modules, just update
./bin/phpX/Dockerfile. You can also generate a PR and we will merge if seems good for general purpose. You have to rebuild the docker image by runningdocker compose buildand restart the docker containers.
You can connect to web server using docker compose exec command to perform various operation on it. Use below command to login to container via ssh.
docker compose exec webserver bash
The installed version of php depends on your .envfile.
By default following extensions are installed. May differ for PHP Versions <7.x.x
If you want to install more extension, just update
./bin/webserver/Dockerfile. You can also generate a PR and we will merge if it seems good for general purpose. You have to rebuild the docker image by runningdocker compose buildand restart the docker containers.
phpMyAdmin is configured to run on port 8080. Use following default credentials.
http://localhost:8080/
username: root
password: tiger
Xdebug comes installed by default and it's version depends on the PHP version chosen in the ".env" file.
Xdebug versions:
PHP <= 7.3: Xdebug 2.X.X
PHP >= 7.4: Xdebug 3.X.X
To use Xdebug you need to enable the settings in the ./config/php/php.ini file according to the chosen version PHP.
Example:
# Xdebug 2
#xdebug.remote_enable=1
#xdebug.remote_autostart=1
#xdebug.remote_connect_back=1
#xdebug.remote_host = host.docker.internal
#xdebug.remote_port=9000
# Xdebug 3
#xdebug.mode=debug
#xdebug.start_with_request=yes
#xdebug.client_host=host.docker.internal
#xdebug.client_port=9003
#xdebug.idekey=VSCODE
Xdebug VS Code: you have to install the Xdebug extension "PHP Debug". After installed, go to Debug and create the launch file so that your IDE can listen and work properly.
Example:
VERY IMPORTANT: the pathMappings depends on how you have opened the folder in VS Code. Each folder has your own configurations launch, that you can view in .vscode/launch.json
{ "version": "0.2.0", "configurations": [ { "name": "Listen for Xdebug", "type": "php", "request": "launch", // "port": 9000, // Xdebug 2 "port": 9003, // Xdebug 3 "pathMappings": { // "/var/www/html": "${workspaceFolder}/www" // if you have opened VSCODE in root folder "/var/www/html": "${workspaceFolder}" // if you have opened VSCODE in ./www folder } } ] }
Now, make a breakpoint and run debug.
Tip! After theses configurations, you may need to restart container.
It comes with Redis. It runs on default port 6379.
Support for https domains is built-in but disabled by default. There are 3 ways you can enable and configure SSL; https on localhost being the easiest. If you are trying to recreating a testing environment as close as possible to a production environment, any domain name can be supported with more configuration.
Notice: For every non-localhost domain name you wish to use https on, you will need to modify your computers hosts file and point the domain name to 127.0.0.1. If you fail to do this SSL will not work and you will be routed to the internet every time you try to visit that domain name locally.
To enable https on localhost (https://localhost) you will need to:
localhost:
mkcert, in the terminal run mkcert localhost 127.0.0.1 ::1.cert.pem and cert-key.pem respectively.config/ssl directory.443 vhost in config/vhosts/default.conf.Done. Now any time you turn on your LAMP container https will work on localhost.
If you would like to use normal domain names for local testing, and need https support, the simplest solution is an SSL certificate that covers all the domain names:
mkcert, in the terminal run mkcert example.com "*.example.org" myapp.dev localhost 127.0.0.1 ::1 where you replace all the domain names and IP addresses to the ones you wish to support.cert.pem and cert-key.pem respectively.config/ssl directory.443 vhost in config/vhosts/default.conf.Done. Since you combined all the domain names into a single certificate, the vhost file will support your setup without needing to modify it further. You could add domain specific rules if you wish however. Now any time you turn on your LAMP container https will work on all the domains you specified.
If you would like your local testing environment to exactly match your production, and need https support, you could create an SSL certificate for every domain you wish to support:
mkcert, in the terminal run mkcert [your-domain-name(s)-here] replacing the bracket part with your domain name.[name]-cert.pem and [name]-cert-key.pem replacing the bracket part with a unique name.config/ssl directory.443 example from the vhost file (config/vhosts/default.conf), make new rules that match your domain name and certificate file names.Done. The LAMP container will auto pull in any SSL certificates in config/ssl when it starts. As long as you configure the vhosts file correctly and place the SSL certificates in config/ssl, any time you turn on your LAMP container https will work on your specified domains.
We are happy if you want to create a pull request or help people with their issues. If you want to create a PR, please remember that this stack is not built for production usage, and changes should be good for general purpose and not overspecialized.
Please note that we simplified the project structure from several branches for each php version, to one centralized master branch. Please create your PR against master branch.
Thank you!
We want to empower developers to quickly create creative Applications. Therefore we are providing an easy to set up a local development environment for several different Frameworks and PHP Versions. In Production you should modify at a minimum the following subjects:


AI 图片生成平台
GPT Image 2 是面向用户的 AI 图片生成平台,支持文生图、图生图及多模型创意工作流。


AI 图片生成工具
输入简单文字,生成想要的图片。支持Nano Banana/gptimage-2等最新模型。


你的AI Agent团队
Vecbase 是专为 AI 团队打造的智能工作空间,将数据管理、模型协作与知识沉淀整合于一处。算法、产品与业务在同一平台无缝协同,让从数据到 AI 应用的落地更快一步。


全球首个AI音乐社区
音述AI是全球首个AI音乐社区,致力让每个人都能用音乐表达自我。音述AI提供零门槛AI创作工具,独创GETI法则帮助用户精准定义音乐风格,AI润色功能支持自动优化作品质感。音述AI支持交流讨论、二次创作与价值变现。针对中文用户的语言习惯与文化背景进行专门优化,支持国风融合、C-pop等本土音乐标签,让技术更好地承载人文表达。


阿里Qoder团队推出的桌面端AI智能体
QoderWork 是阿里推出的本地优先桌面 AI 智能体,适配 macOS14+/Windows10+,以自然语言交互实现文件管理、数据分析、AI 视觉生成、浏览器自动化等办公任务,自主拆解执行复杂工作流,数据本地运行零上传,技能市场可无限扩展,是高效的 Agentic 生产力办公助手。


一站式搞定所有学习需求
不再被海量信息淹没,开始真正理解知识。Lynote 可摘要 YouTube 视频、PDF、文章等内容。即时创建笔记,检测 AI 内容并下载资料,将您的学习效率提升 10 倍。


为AI短剧协作而生
专为AI短剧协作而生的AniShort正式发布,深度重构AI短剧全流程生产模式,整合创意策划、制作执行、实时协作、在线审片、资产复用等全链路功能,独创无限画布、双轨并行工业化工作流与Ani智能体助手,集成多款主流AI大模型,破解素材零散、版本混乱、沟通低效等行业痛点,助力3人团队效率提升800%,打造标准化、可追溯的AI短剧量产体系,是AI短剧团队协同创作、提升制作效率的核心工具。


能听懂你表达的视频模型
Seedance two是基于seedance2.0的中国大模型,支持图像、视频、音频、文本四种模态输入,表达方式更丰富,生成也更可控。


国内直接访问,限时3折
输入简单文字,生成想要的图片,纳米香蕉中文站基于 Google 模型的 AI 图片生成网站,支持文字生图、图生图。官网价格限时3折活动


职场AI,就用扣子
AI办公助手,复杂任务高效处理。办公效率低?扣子空间AI助手支持播客生成、PPT制作、网页开发及报告写作,覆盖科研、商业、舆情等领域的专家Agent 7x24小时响应,生活工作无缝切换,提升50%效率!
最新AI工具、AI资讯
独家AI资源、AI项目落地

微信扫一扫关注公众号