{"id":17660988,"url":"https://github.com/soulteary/ngx-php-micro-blog","last_synced_at":"2026-03-09T12:31:29.610Z","repository":{"id":148701692,"uuid":"544867751","full_name":"soulteary/ngx-php-micro-blog","owner":"soulteary","description":"Microlog example based on Nginx and Nginx module (NGX-PHP8), A high-performance implementation that does not use the combination of Nginx and PHP-FPM, which is safe and reliable.","archived":false,"fork":false,"pushed_at":"2022-10-05T12:41:40.000Z","size":365,"stargazers_count":12,"open_issues_count":2,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-07T17:07:53.469Z","etag":null,"topics":["microblog","nginx","nginx-docker","nginx-module","nginx-php","ngx-php","php"],"latest_commit_sha":null,"homepage":"https://soulteary.com/2022/10/05/nginx-black-magic-low-cost-high-performance-applications-using-ngx-php-modules.html","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/soulteary.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-03T11:24:25.000Z","updated_at":"2024-12-19T13:56:46.000Z","dependencies_parsed_at":"2023-06-04T18:00:43.279Z","dependency_job_id":null,"html_url":"https://github.com/soulteary/ngx-php-micro-blog","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soulteary%2Fngx-php-micro-blog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soulteary%2Fngx-php-micro-blog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soulteary%2Fngx-php-micro-blog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soulteary%2Fngx-php-micro-blog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/soulteary","download_url":"https://codeload.github.com/soulteary/ngx-php-micro-blog/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252922346,"owners_count":21825637,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["microblog","nginx","nginx-docker","nginx-module","nginx-php","ngx-php","php"],"created_at":"2024-10-23T17:09:52.531Z","updated_at":"2026-03-09T12:31:29.525Z","avatar_url":"https://github.com/soulteary.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nginx NGX-PHP Module Demo (MicroBlog)\n\n[English Ver](./README_EN.md) / [中文教程](https://soulteary.com/2022/10/05/nginx-black-magic-low-cost-high-performance-applications-using-ngx-php-modules.html)\n\n使用 Nginx 模块 NGX-PHP 实现的一个简单的微博应用 Demo，不依赖 PHP-FPM 等技术栈，高效、安全、可靠。\n\n![](./screenshots/docker.png)\n\n基于 Nginx 官方容器构建，基础镜像仅 12MB。\n\n## 界面预览\n\n![](./screenshots/list.png)\n\n## 使用方法\n\n启动容器：\n\n```bash\ndocker run --rm -it -v `pwd`/data:/usr/share/nginx/html/data:rw -p 8090:80 soulteary/ngx-php:8-microblog\n```\n\n或者使用 `docker compose`:\n\n```bash\ndocker-compose -f docker-compose.ngx-php.yml up\n```\n\n打开浏览器：`http://localhost:8090`\n\n![](./screenshots/post.png)\n\n## 性能测试\n\n对比 `soulteary/ngx-php:8` 和 `php:8.1.10-apache-buster`。\n\n### soulteary/ngx-php:8\n\n```bash\nwrk -t16 -c 100 -d 30s http://127.0.0.1:8090     \nRunning 30s test @ http://127.0.0.1:8090\n  16 threads and 100 connections\n  Thread Stats   Avg      Stdev     Max   +/- Stdev\n    Latency    94.01ms   15.94ms 431.01ms   81.62%\n    Req/Sec    64.02     11.33   148.00     74.26%\n  30715 requests in 30.09s, 65.03MB read\nRequests/sec:   1020.65\nTransfer/sec:      2.16MB\n```\n\n### php:8.1.10-apache-buster (`opcache.enable=1`)\n\n```bash\nwrk -t16 -c 100 -d 30s http://127.0.0.1:8090     \nRunning 30s test @ http://127.0.0.1:8090\n  16 threads and 100 connections\n  Thread Stats   Avg      Stdev     Max   +/- Stdev\n    Latency   132.92ms  158.49ms   1.98s    86.67%\n    Req/Sec    54.38     56.83   670.00     94.88%\n  22603 requests in 30.08s, 49.40MB read\n  Socket errors: connect 0, read 0, write 0, timeout 112\nRequests/sec:    751.53\nTransfer/sec:      1.64MB\n```\n\n## 相关项目\n\n- Nginx 模块 NGX-PHP: [https://github.com/rryqszq4/ngx-php](https://github.com/rryqszq4/ngx-php)\n- Nginx Docker 快速开发环境: [https://github.com/nginx-with-docker/nginx-docker-playground](https://github.com/nginx-with-docker/nginx-docker-playground)\n- SVG 图标: [信息图标](https://www.iconfont.cn/collections/detail?cid=30328) [界面Logo](https://www.iconfont.cn/collections/detail?cid=36911)\n- 前端框架 [Bootstrap](https://github.com/twbs)\n- JavaScript 计算过去时间: [twas](https://github.com/vutran/twas)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoulteary%2Fngx-php-micro-blog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoulteary%2Fngx-php-micro-blog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoulteary%2Fngx-php-micro-blog/lists"}