jlucki/docker-php-dev-env
Composer 安装命令:
composer create-project jlucki/docker-php-dev-env
包简介
A simple web development environment using Docker with NGINX, PHP, MySQL and Xdebug.
README 文档
README
This repository allows you to quickly get a development environment up and running using Docker, including a MySQL database and some debugging tools.
This environment includes the latest versions of the following software:
nginx:alpinephp:8.5-fpmmysql:latestxdebug
Prerequisites
- Docker - https://www.docker.com/products/docker-desktop
- Tested and confirmed working on:
- macOS 15.7.1 (Sequoia)
- Windows 10 Version 21H1 build 19043.1165
Project Setup
Run composer create-project jlucki/docker-php-dev-env "project_name"
Alternatively, download the files from this repo and copy them to your project directory.
Running the Container
- Run
docker compose up -dfrom the project directory- The above command will only work on versions newer than 3.6. If you are using Docker 3.6 or older, use
docker-compose up -d - You can check running containers withg
docker ps
- The above command will only work on versions newer than 3.6. If you are using Docker 3.6 or older, use
- Visit
localhostin your browser
Setting up Xdebug in Your IDE
The following instructions are for PHPStorm.
- Click on Run > Edit Configurations
- Click the
+and add a new PHP Remote Debug configuration - Give the configuration a name
- Tick Filter debug connection by IDE key
- Add
PHPSTORMin the session id - Click the
...next to Server - Click the
+to add a new server - Give the server a name, and set the host to
localhost - Tick Use path mappings
- Under the
Project filesfile/directory, next to your project folder, for theAbsolute path on the servercolumn add/var/www/html - Hit Apply and OK until you've returned to the IDE
- Click the Start Listening for PHP Debug Connections icon
- Set a breakpoint in your code
- Refresh the page in your browser
- Accept Incoming Connection From Xdebug
- Happy debugging!
See https://xdebug.org/docs/remote for how to enable xdebug sessions.
Additional Notes
For database connections, use mysql as the hostname. If you would like a different hostname, change the service name in the docker-compose.yml file.
Windows 10 Troubleshooting
For troubleshooting tips see the wiki.
jlucki/docker-php-dev-env 适用场景与选型建议
jlucki/docker-php-dev-env 是一款 基于 Dockerfile 开发的 Composer 扩展包,目前已累计 173 次下载、GitHub Stars 达 29, 最近一次更新时间为 2020 年 02 月 17 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「Xdebug」 「development」 「environment」 「nginx」 「docker」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 jlucki/docker-php-dev-env 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 jlucki/docker-php-dev-env 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 jlucki/docker-php-dev-env 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Runs a php script with XDebug disabled
Debugging a problem and need to login as one of your customers? This allows you to authenticate as any of your customers.
😎 Tracy: the addictive tool to ease debugging PHP code for cool developers. Friendly design, logging, profiler, advanced features like debugging AJAX calls or CLI support. You will love it.
Library with classes to help you do batch.
GHT D-Tools Bundle
😎 Tracy: the addictive tool to ease debugging PHP code for cool developers. Friendly design, logging, profiler, advanced features like debugging AJAX calls or CLI support. You will love it.
统计信息
- 总下载量: 173
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 30
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-02-17