{"id":20031352,"url":"https://github.com/goldstrike77/ansible-role-linux-phpfpm","last_synced_at":"2026-05-08T09:34:07.257Z","repository":{"id":130073838,"uuid":"145659614","full_name":"goldstrike77/ansible-role-linux-phpfpm","owner":"goldstrike77","description":"Ansible role for install and configure PHP-FPM on linux operating system.","archived":false,"fork":false,"pushed_at":"2021-02-18T02:18:06.000Z","size":8593,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-08-21T16:23:17.598Z","etag":null,"topics":["ansible","ansible-role","php","php-fpm"],"latest_commit_sha":null,"homepage":"","language":"HTML","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/goldstrike77.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":"2018-08-22T05:18:14.000Z","updated_at":"2021-02-18T02:18:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"c276d8e7-be51-44d6-931b-1656d4aa427f","html_url":"https://github.com/goldstrike77/ansible-role-linux-phpfpm","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/goldstrike77/ansible-role-linux-phpfpm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goldstrike77%2Fansible-role-linux-phpfpm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goldstrike77%2Fansible-role-linux-phpfpm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goldstrike77%2Fansible-role-linux-phpfpm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goldstrike77%2Fansible-role-linux-phpfpm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/goldstrike77","download_url":"https://codeload.github.com/goldstrike77/ansible-role-linux-phpfpm/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goldstrike77%2Fansible-role-linux-phpfpm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32775002,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"ssl_error","status_checked_at":"2026-05-08T08:22:45.650Z","response_time":54,"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":["ansible","ansible-role","php","php-fpm"],"created_at":"2024-11-13T09:32:35.556Z","updated_at":"2026-05-08T09:34:07.239Z","avatar_url":"https://github.com/goldstrike77.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"![](https://img.shields.io/badge/Ansible-php-green.svg?logo=angular\u0026style=for-the-badge)\n\n\u003e__Please note that the original design goal of this role was more concerned with the initial installation and bootstrapping environment, which currently does not involve performing continuous maintenance, and therefore are only suitable for testing and development purposes,  should not be used in production environments.__\n\n\u003e__请注意，此角色的最初设计目标更关注初始安装和引导环境，目前不涉及执行连续维护，因此仅适用于测试和开发目的，不应在生产环境中使用。__\n___\n\n\u003cp\u003e\u003cimg src=\"https://raw.githubusercontent.com/goldstrike77/goldstrike77.github.io/master/img/logo/logo_php.png\" align=\"right\" /\u003e\u003c/p\u003e\n\n__Table of Contents__\n\n- [Overview](#overview)\n- [Requirements](#requirements)\n  * [Operating systems](#operating-systems)\n  * [PHP Versions](#PHP-versions)\n- [ Role variables](#Role-variables)\n  * [Main Configuration](#Main-parameters)\n  * [Other Configuration](#Other-parameters)\n- [Dependencies](#dependencies)\n- [Example Playbook](#example-playbook)\n  * [Hosts inventory file](#Hosts-inventory-file)\n  * [Vars in role configuration](#vars-in-role-configuration)\n  * [Combination of group vars and playbook](#combination-of-group-vars-and-playbook)\n- [License](#license)\n- [Author Information](#author-information)\n- [Contributors](#Contributors)\n\n## Overview\nPHP is a general-purpose scripting language that is especially suited to web development.\n\n## Requirements\n### Operating systems\nThis Ansible role installs PHP on linux operating system, including establishing a filesystem structure and server configuration with some common operational features, Will works on the following operating systems:\n\n  * CentOS 7\n\n### PHP versions\n\nThe following list of supported the PHP releases:\n\n  * PHP 7.x\n\n## Role variables\n### Main parameters #\nThere are some variables in defaults/main.yml which can (Or needs to) be overridden:\n\n##### General parameters\n* `php_version`: Specify the php-fpm version.\n\n##### Listen port\n* `php_fpm_port`: Defines Php-fpm instance listening port.\n* `php_fpm_exporter_port`: Prometheus exporter.\n\n##### PHP Variables\n* `php_allow_url_fopen`: Whether to allow accessing URL object like files.\n* `php_allow_url_include`: Whether to allow use of URL-aware with the include/require functions.\n* `php_date_timezone`: The default timezone used by all date/time functions.\n* `php_default_socket_timeout`: Default timeout for socket based streams in seconds.\n* `php_error_log`: Send an error message to the defined error handling routines.\n* `php_expose_php`: Exposes to the world that PHP is installed on the server.\n* `php_file_uploads`: Whether or not to allow HTTP file uploads.\n* `php_max_execution_time`: Script maximum time is allowed to run before it is terminated by the parser in seconds.\n* `php_max_file_uploads`: The maximum number of files allowed to be uploaded via single request.\n* `php_max_input_time`: Script maximum time is allowed to parse input data in seconds.\n* `php_memory_limit`: The maximum amount of memory in megabyte that a script is allowed to allocate.\n* `php_post_max_size`: The maximum size in megabyte of post data allowed.\n* `php_realpath_cache_size`: The maximum size in megabyte of the realpath cache to be used by PHP.\n* `php_upload_max_filesize`: The maximum size in megabyte of files allowed to be uploaded.\n* `php_upload_tmp_dir`: The temporary directory used for storing files when doing file upload.\n\n##### PHP-FPM Variables\n* `php_emergency_restart_interval`: Interval of time to determine when a graceful restart in seconds.\n* `php_emergency_restart_threshold`: Number of child processes exit with SIGSEGV or SIGBUS signal.\n* `php_log_level`: Error log level.\n* `php_process_control_timeout`: Time limit for child processes to wait for a reaction on signals from master in seconds.\n\n##### PHP-FPM POOL Variables\n* `php_user`: Unix user of processes.\n* `php_group`: Unix group of processes.\n* `php_listen_backlog`: The maximum rate at which a server can accept new TCP connections on a socket.\n* `php_listen_owner`: Listen owner user.\n* `php_listen_group`: Listen owner group.\n* `php_listen_mode`: Listen permissions.\n* `php_pm`: Child process control manager.\n* `php_pm_max_requests`: The number of requests each child process should execute before respawning.\n\n##### Service Mesh\n* `environments`: Define the service environment.\n* `datacenter`: Define the DataCenter.\n* `domain`: Define the Domain.\n* `tags`: Define the service custom label.\n* `exporter_is_install`: Whether to install prometheus exporter.\n* `consul_public_register`: Whether register a exporter service with public consul client.\n* `consul_public_exporter_token`: Public Consul client ACL token.\n* `consul_public_http_prot`: The consul Hypertext Transfer Protocol.\n* `consul_public_clients`: List of public consul clients.\n* `consul_public_http_port`: The consul HTTP API port.\n\n### Other parameters\nThere are some variables in vars/main.yml:\n\n## Dependencies\n- Ansible versions \u003e= 2.8\n- Python \u003e= 2.7.5\n\n## Example\n\n### Hosts inventory file\nSee tests/inventory for an example.\n\n    node01 ansible_host='192.168.1.10' php_version='70'\n\n### Vars in role configuration\nIncluding an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:\n\n```yaml\n- hosts: all\n  roles:\n     - role: ansible-role-linux-phpfpm\n       php_version: '70'\n```\n\n### Combination of group vars and playbook\nYou can also use the group_vars or the host_vars files for setting the variables needed for this role. File you should change: group_vars/all or host_vars/`group_name`\n\n```yaml\nphp_version: '70'\nphp_fpm_port: '9000'\nphp_fpm_exporter_port: '9253'\nphp_allow_url_fopen: 'On'\nphp_allow_url_include: 'Off'\nphp_date_timezone: 'Asia/Shanghai'\nphp_default_socket_timeout: '60'\nphp_error_log: 'syslog'\nphp_expose_php: 'Off'\nphp_file_uploads: 'On'\nphp_max_execution_time: '60'\nphp_max_file_uploads: '20'\nphp_max_input_time: '60'\nphp_memory_limit: '256'\nphp_post_max_size: '2'\nphp_realpath_cache_size: '16'\nphp_upload_max_filesize: '5'\nphp_upload_tmp_dir: '/tmp'\nphp_emergency_restart_interval: '60'\nphp_emergency_restart_threshold: '20'\nphp_log_level: 'notice'\nphp_process_control_timeout: '10'\nphp_user: 'apache'\nphp_group: 'apache'\nphp_listen_backlog: '16384'\nphp_listen_owner: 'apache'\nphp_listen_group: 'apache'\nphp_listen_mode: '0660'\nphp_pm: 'dynamic'\nphp_pm_max_requests: '300'\nenvironments: 'Development'\ndatacenter: 'dc01'\ndomain: 'local'\ntags:\n  subscription: 'default'\n  owner: 'nobody'\n  department: 'Infrastructure'\n  organization: 'The Company'\n  region: 'China'\nexporter_is_install: false\nconsul_public_register: false\nconsul_public_exporter_token: '00000000-0000-0000-0000-000000000000'\nconsul_public_http_prot: 'https'\nconsul_public_http_port: '8500'\nconsul_public_clients:\n  - '127.0.0.1'\n```\n\n## License\n![](https://img.shields.io/badge/MIT-purple.svg?style=for-the-badge)\n\n## Author Information\nPlease send your suggestions to make this role better.\n\n## Contributors\nSpecial thanks to the [Connext Information Technology](http://www.connext.com.cn) for their contributions to this role.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoldstrike77%2Fansible-role-linux-phpfpm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoldstrike77%2Fansible-role-linux-phpfpm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoldstrike77%2Fansible-role-linux-phpfpm/lists"}