{"id":43515378,"url":"https://github.com/zaioll/php-zts","last_synced_at":"2026-02-03T13:39:56.116Z","repository":{"id":65084306,"uuid":"210688905","full_name":"zaioll/php-zts","owner":"zaioll","description":"Docker image for compiled PHP-FPM-ZTS out-of-the-box with pthreads, nginx and dynamic configuration through env vars at container init.","archived":false,"fork":false,"pushed_at":"2022-05-25T11:07:30.000Z","size":614,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-03-05T08:42:04.419Z","etag":null,"topics":["compiled","composer","decimal","docker-image","dynamic-configuration","nginx","nginx-configuration","out-of-the-box","parallel","php","php-amqplib","php-fpm-74","php-redis","php-zts","php74","pthreads","runtime-configuration","vscode","xdebug"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zaioll.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}},"created_at":"2019-09-24T20:09:42.000Z","updated_at":"2022-12-24T10:30:46.000Z","dependencies_parsed_at":"2023-01-01T00:36:15.895Z","dependency_job_id":null,"html_url":"https://github.com/zaioll/php-zts","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"purl":"pkg:github/zaioll/php-zts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zaioll%2Fphp-zts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zaioll%2Fphp-zts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zaioll%2Fphp-zts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zaioll%2Fphp-zts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zaioll","download_url":"https://codeload.github.com/zaioll/php-zts/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zaioll%2Fphp-zts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29046675,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-03T10:09:22.136Z","status":"ssl_error","status_checked_at":"2026-02-03T10:09:16.814Z","response_time":96,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["compiled","composer","decimal","docker-image","dynamic-configuration","nginx","nginx-configuration","out-of-the-box","parallel","php","php-amqplib","php-fpm-74","php-redis","php-zts","php74","pthreads","runtime-configuration","vscode","xdebug"],"created_at":"2026-02-03T13:39:55.793Z","updated_at":"2026-02-03T13:39:56.104Z","avatar_url":"https://github.com/zaioll.png","language":"Shell","readme":"![PHP Version](https://img.shields.io/badge/php-7.4-blue)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n![Twitter Follow](https://img.shields.io/twitter/follow/zaioll?label=follow\u0026style=social)\n\n# PHP-ZTS Docker image\n\nPHP is a popular general-purpose scripting language that is especially suited to\nweb development. Fast, flexible and pragmatic, PHP powers everything from your\nblog to the most popular websites in the world.\n\n## Getting start\n\n### Daemon\n\nWhen running docker image as a daemon, the `/run/init/start` shell script is executed at startup.\n\n```bash\nuser@host:$ docker run -d -it --name ${my_container_name} -v \"${host_path}:/var/www/html\" zaioll/php-zts:${php_version}\n```\n\nTo share the socket file, create shared volume first:\n\n```bash\nuser@host:$ docker volume create sock\n```\n\nThen, run the container passing the created shared volume.\n\n```bash\nuser@host:$ docker run -d -it -v \"sock:/run/php\" -v \"${host_path}:/var/www/html\" --name ${my_container_name} zaioll/php-zts:${php_version}\n```\n\n\u003e The `/run/init/hook-start` shell script is called at the end of `/run/init/start` running process and before start `supervisord`. Add your custom shell script commands into it to run it.\n\n### Interactive\n\nWhen running docker image as a iteractive form, the `/run/init/start` shell script is not executed. Then, PHP-FPM is not started. It needs manual run.\n\n\n\n### Configuration with environment variables\n\n- `APP_ENV` = ( ^dev* | ^prod* | debug ) Default: `dev`\n    - Main diretive to configure the entire environment. When **APP_ENV** is configured with \"dev\" value, the **xdebug** will be enabled and configured and PHP (and webserver if it's enabled) default *timeouts* and *time limits* will be incresead at **8 times**. On the other hand, if **APP_ENV** is configured with \"prod\" value, the **opcache** will be enabled and configured. PHP defaults values for *timeouts* will be decreased to 10% of the default values.\n\n        - Default overwritten prod PHP config:\n\n            ```bash\n            PHP_INI=\"\n                cgi.fix_pathinfo=0\n                display_startup_errors=Off\n                memory_limit=${memory_limit}M\n                zend.assertions=-1\n                report_memleaks=Off\n                display_errors=Off\n                log_errors=Off\n                expose_php=Off\n                max_execution_time=${max_execution_time}\n                date.time_zone=America/Manaus\n                session.cookie_secure=On\"\n            ```\n\n        - Default overwritten dev PHP config:\n\n            ```bash\n            PHP_INI=\"\n                cgi.fix_pathinfo=0\n                display_startup_errors=On\n                implicit_flush=On\n                memory_limit=${memory_limit}M\n                display_errors=On\n                log_errors=On\n                expose_php=On\n                max_execution_time=${max_execution_time}\n                date.time_zone=America/Manaus\n                session.cookie_secure=Off\"\n            ```\n\n- `PHP_FPM_SOCKET`=( off | on ) Default: `on`\n    - To enable PHP-FPM socket, set `ENABLE_FPM_SOCKET` env var to `on` to create and communicate through unix socket file **/run/php/php7-fpm.sock** or set to `off` for communication through **tcp/9000** port instead.\n- `WEB_SERVER`=( on | off ) Default: `on`\n- `OPCACHE_CONF`=( off | \\$config ) Default: `$config` when prod environment\n- [`XDEBUG_CONFIG`](https://xdebug.org/docs/remote) = ( off | \\$config ) Default: `$config` when dev environment\n    - If Xdebug is enabled, the PHP-FPM expects xdebug\n    configuration through `XDEBUG_CONFIG` env var.\n    \u003e If `ENABLE_FPM_SOCKET` = \"off\", **xdebug.remote_port** will be configured to use **9003** port.\n\n- `REDIS`=( on | off ) Default: `off`\n- `ENABLE_MEMCACHED`=( on | off ) Default: `off`\n- `ENABLE_PARALLEL`=( on | off ) Default: `on`\n- `ENABLE_MONGODB`=( on | off ) Default: `off`\n- `ENABLE_SWOOLE`=( on | off ) Default: `off`\n- `ENABLE_AMQP`=( on | off ) Default: `off`\n- `ENABLE_SODIUM`=( on | off ) Default: `on`\n- `ENABLE_DECIMAL`=( on | off ) Default: `on`\n\n## PHP Documentation\n\nThe PHP manual is available at [php.net/docs](https://php.net/docs).\n\n## Docker image\n\n### Possible PHP versions\n\nAt every compilation, the last **patch** version is fetched.\n\n[EBNF](https://bnfplayground.pauliankline.com/?bnf=%3Cphp_version_installed%3E%20%20%20%3A%3A%3D%20%3Cphp_version%3E%20%3Cseparator%3E%20%3Cpatch%3E%0A%3Cphp_version%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%3A%3A%3D%20%3Cmajor%3E%20%3Cseparator%3E%20%3Cminor%3E%0A%3Cmajor%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3A%3A%3D%20%227%22%0A%3Cseparator%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3A%3A%3D%20%22.%22%0A%3Cminor%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3A%3A%3D%20%222%22%20%7C%20%224%22%0A%3Cpatch%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3A%3A%3D%20%20(%20%220%22%20%7C%20%5B1-9%5D%20%5B0-9%5D*)%20%20\u0026name=):\n\n    \u003cphp_version_installed\u003e   ::= \u003cphp_version\u003e \u003cseparator\u003e \u003cpatch\u003e\n    \u003cphp_version\u003e             ::= \u003cmajor\u003e \u003cseparator\u003e \u003cminor\u003e\n    \u003cmajor\u003e                   ::= \"7\"\n    \u003cseparator\u003e               ::= \".\"\n    \u003cminor\u003e                   ::= \"1\" | \"2\" | \"3\" | \"4\"\n    \u003cpatch\u003e                   ::=  ( \"0\" | [1-9] [0-9]*)\n\n\n## Features\n\n- [Composer 2.X](https://getcomposer.org/) for dependency management in PHP.\n- Nginx and Apache2 webservers\n- [PhpBench](https://github.com/phpbench/phpbench) tool.\n- [Phive](https://phar.io/)\n\n### Modules\n\n- [Parallel](https://https://github.com/krakjoe/parallel.git)\n- [Swoole](https://www.swoole.co.uk/)\n- [Decimal](https://php-decimal.io/)\n- [Xdebug](https://github.com/xdebug/xdebug.git)\n- [Memcached](https://github.com/php-memcached-dev/php-memcached.git)\n- [Mongodb](https://github.com/mongodb/mongo-php-driver.git)\n- [Redis](https://github.com/phpredis/phpredis.git)\n- [Sodium]\n- [PHP AMQP](https://github.com/php-amqp/php-amqp)\n\n### Installed libs and extensions\n\nInside `/info/` directory are compile and info logs files\n\n- [Installed Libs](benckmarks/installed-libs.md)\n- [Installed PHP extensions](benckmarks/installed-php-extensions.md)\n\n## Benchmarks\n\n### Environment\n\nThe benchmarks were generated by the [Apache ab](https://httpd.apache.org/docs/2.4/programs/ab.html), making requests on `index.php` script over the PHP built-in web server and plotted with the [gnuplot](http://www.gnuplot.info/) program with configurations inspired in [this](http://www.bradlanders.com/2013/04/15/apache-bench-and-gnuplot-youre-probably-doing-it-wrong/) article.\n\n```php\n// /index.php\n\u003c?php\nfor ($i = 0; $i \u003c 50; $i++) {\n    if ($i % 2 == 0) {\n        echo \".\";\n        continue;\n    }\n    echo \"*\";\n}\n```\n\n```ini\n[opcache]\nzend_extension=${extension_dir}/opcache.so\nopcache.enable=1\nopcache.enable_cli=0\nopcache.validate_timestamps=0\nopcache.max_accelerated_files=65406\nopcache.memory_consumption=256\nopcache.interned_strings_buffer=12\nopcache.fast_shutdown=1\nopcache.enable_file_override=1\n```\n\n```\n# Tell gnuplot to use tabs as the delimiter instead of spaces (default)\nset datafile separator '\\t'\n\n# Output to a jpeg file\nset terminal jpeg size 1280,720\n\n# Set the aspect ratio of the graph\nset size 1, 1\n\n# The file to write to\nset output \"\u003cconnections\u003e_\u003cconcurrency\u003e.jpg\"\n\n# The graph title\nset title \"Benchmark testing with opcache enabled and xdebug disabled: ab -n \u003cconnections\u003e -c \u003cconcurrency\u003e -g out.data http://localhost/\"\n\n# Where to place the legend/key\nset key left top\n\n# Draw gridlines oriented on the y axis\nset grid y\n\n# Specify that the x-series data is time data\nset xdata time\n\n# Specify the *input* format of the time data\nset timefmt \"%s\"\n\n# Specify the *output* format for the x-axis tick labels\nset format x \"%S\"\n\n# Label the x-axis\nset xlabel 'seconds'\n\n# Label the y-axis\nset ylabel \"response time (ms)\"\n\n# Plot the data\nplot \"out.data\" every ::2 using 2:5 title 'response time' with points \nexit\n```\n\n### Results\n\n- 300 requests, 80 concurrent connections\n\n![Test 01](/benckmarks/300_80_cl.jpg)\n\n![Test 01](/benckmarks/300_80_op.jpg)\n\n- 2000 requests, 800 concurrent connections\n\n![Test 03](/benckmarks/2000_800_cl.jpg)\n\n![Test 04](/benckmarks/2000_800_op.jpg)\n\n- 5000 requests, 800 concurrent connections\n\n![Test 05](/benckmarks/5000_800_cl.jpg)\n\n![Test 06](/benckmarks/5000_800_op.jpg)\n\n- 50000 requests, 1020 concurrent connections\n\n![Test 07](/benckmarks/50000_1020_cl.jpg)\n\n![Test 07](/benckmarks/50000_1020_op.jpg)\n\n## Licence\n\nMIT\n\n---\n\n\u003ca href=\"https://www.buymeacoffee.com/layro\" target=\"_blank\"\u003e\u003cimg src=\"https://cdn.buymeacoffee.com/buttons/lato-blue.png\" alt=\"Buy Me A Coffee\" height=\"30px\" width=\"120px\"\u003e\u003c/a\u003e\n","funding_links":["https://www.buymeacoffee.com/layro"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzaioll%2Fphp-zts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzaioll%2Fphp-zts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzaioll%2Fphp-zts/lists"}