{"id":19583822,"url":"https://github.com/bodsch/ansible-php","last_synced_at":"2025-04-27T10:33:11.735Z","repository":{"id":43870686,"uuid":"301605866","full_name":"bodsch/ansible-php","owner":"bodsch","description":"install and configure PHP. primary used for php-fpm.","archived":false,"fork":false,"pushed_at":"2024-08-19T10:18:21.000Z","size":163,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-08-19T12:14:12.472Z","etag":null,"topics":["ansible","automation","php","php-fpm","web-application"],"latest_commit_sha":null,"homepage":"","language":"Python","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/bodsch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"2020-10-06T03:41:09.000Z","updated_at":"2024-08-19T10:18:24.000Z","dependencies_parsed_at":"2023-02-09T21:31:02.849Z","dependency_job_id":"4b53b84c-33a5-4c83-b75d-2f2a0065aecc","html_url":"https://github.com/bodsch/ansible-php","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bodsch%2Fansible-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bodsch%2Fansible-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bodsch%2Fansible-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bodsch%2Fansible-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bodsch","download_url":"https://codeload.github.com/bodsch/ansible-php/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224069628,"owners_count":17250451,"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":["ansible","automation","php","php-fpm","web-application"],"created_at":"2024-11-11T07:44:59.573Z","updated_at":"2025-04-27T10:33:11.724Z","avatar_url":"https://github.com/bodsch.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Ansible Role:  `php`\n\nAnsible role to install fpm-php on various systems.\n\n---\n\n\u003e Further development of this Ansible role has been moved to Collection [bodsch.php](https://github.com/bodsch/ansible-collection-php).\n\u003e **This repository will therefore no longer be actively maintained.**\n\n---\n\nOnly inspired by [geerlingguy](https://github.com/geerlingguy/ansible-role-php)\n\nDetect available PHP Version based on `php_version` Variable.\n\nSupports PHP version 7 and 8, **as long as the corresponding versions are available.**\n\nArchLinux has removed the PHP 7 packages from their repository!\n\n[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/bodsch/ansible-php/main.yml?branch=main)][ci]\n[![GitHub issues](https://img.shields.io/github/issues/bodsch/ansible-php)][issues]\n[![GitHub release (latest by date)](https://img.shields.io/github/v/release/bodsch/ansible-php)][releases]\n[![Ansible Downloads](https://img.shields.io/ansible/role/d/bodsch/php?logo=ansible)][galaxy]\n\n[ci]: https://github.com/bodsch/ansible-php/actions\n[issues]: https://github.com/bodsch/ansible-php/issues?q=is%3Aopen+is%3Aissue\n[releases]: https://github.com/bodsch/ansible-php/releases\n[galaxy]: https://galaxy.ansible.com/ui/standalone/roles/bodsch/php\n\n## Requirements \u0026 Dependencies\n\nAnsible Collections\n\n- [bodsch.core](https://github.com/bodsch/ansible-collection-core)\n\n```bash\nansible-galaxy collection install bodsch.core\n```\nor\n```bash\nansible-galaxy collection install --requirements-file collections.yml\n```\n\n\n### Operating systems\n\nTested on\n\n* ArchLinux (**only PHP 8!**)\n* Debian based\n    - Debian 12\n    - Ubuntu 22.04\n\n\u003e **RedHat-based systems are no longer officially supported! May work, but does not have to.**\n\n\n## usage\n\n```yaml\n# choose your version!\nphp_version: \"8\"\n\nphp_packages_state: present\n\nphp_fpm_log_directory: /var/log/php-fpm\nphp_fpm_tmp_upload_directory: /tmp/php-fpm\nphp_fpm_socket_directory: /run/php\n\nphp_fpm_log_level: notice\n\nphp_enable_php_fpm: true\n\nphp_fpm_listen: \"127.0.0.1:9000\"\nphp_fpm_listen_allowed_clients: \"127.0.0.1\"\nphp_fpm_pm:\n  max_children: 50\n  start_servers: 5\n  spare_servers:\n    min: 5\n    max: 5\n\nphp_use_managed_ini: true\n\nphp_expose_php: \"On\"\nphp_memory_limit: \"256M\"\nphp_max_execution_time: \"60\"\nphp_max_input_time: \"60\"\nphp_max_input_vars: \"1000\"\nphp_realpath_cache_size: \"32K\"\n\nphp_file_uploads: \"On\"\nphp_upload_max_filesize: \"64M\"\nphp_max_file_uploads: \"20\"\n\nphp_post_max_size: \"32M\"\nphp_date_timezone: \"Europe/Berlin\"\nphp_allow_url_fopen: \"On\"\n\nphp_sendmail_path: \"/usr/sbin/sendmail -t -i\"\nphp_output_buffering: \"4096\"\nphp_short_open_tag: \"Off\"\nphp_disable_functions: []\n\nphp_session_cookie_lifetime: 0\nphp_session_gc_probability: 1\nphp_session_gc_divisor: 1000\nphp_session_gc_maxlifetime: 1440\nphp_session_save_handler: files\nphp_session_save_path: ''\nphp_session_cache_expire: 180\n\nphp_error_reporting: \"E_ALL \u0026 ~E_DEPRECATED \u0026 ~E_STRICT\"\nphp_display_errors: \"Off\"\nphp_display_startup_errors: \"Off\"\n\nphp_packages: []\n\nphp_fpm_default_pool:\n  delete: false\n  name: www.conf\n\nphp_fpm_pools: []\n\n# php modules\nphp_modules: []\n```\n\n### custom packages\n\nTo install more PHP packages, you can find a list at `php_packages` specify.\n\nE.G.:\n\n```yaml\nphp_packages:\n  - php-ldap\n```\n\nThe packages do not require version information, as it would be necessary for RedHat and Remis packages,\nfor example. The role takes care that the package name is valid.\n\nAs an example, `php-ldap` would be `php73-php-ldap`.\n\n\n### php pools\n\n```yaml\nphp_fpm_pools:\n  - name: worker-01\n    user: \"{{ php_fpm_pool_user }}\"\n    group: \"{{ php_fpm_pool_group }}\"\n    listen.owner: \"{{ php_fpm_pool_user }}\"\n    listen.group: \"{{ php_fpm_pool_group }}\"\n    listen: \"{{ php_fpm_socket_directory }}/$pool.sock\"\n    # static, dynamic or ondemand\n    pm: ondemand\n    pm.max_children: 10\n    pm.start_servers: 4\n    pm.min_spare_servers: 2\n    pm.max_spare_servers: 6\n    pm.status_path: /status\n\n  - name: worker-02\n    user: \"{{ php_fpm_pool_user }}\"\n    group: \"{{ php_fpm_pool_group }}\"\n    listen.owner: \"{{ php_fpm_pool_user }}\"\n    listen.group: \"{{ php_fpm_pool_group }}\"\n    listen: \"{{ php_fpm_socket_directory }}/$pool.sock\"\n    pm: dynamic\n    pm.max_children: 10\n    pm.start_servers: 4\n    pm.min_spare_servers: 2\n    pm.max_spare_servers: 6\n    pm.status_path: /status\n    ping.path: /ping\n    ping.response: pong\n    access.log: \"{{ php_fpm_log_directory }}/$pool_access.log\"\n    access.format: \"%R - %n - %{HTTP_HOST}e - %u %t \\\"%m %r [%Q%q]\\\" %s %f %{mili}d %{kilo}M %C%%\"\n    chdir: /\n    env:\n      PATH: \"/usr/local/bin:/usr/bin:/bin\"\n      TMPDIR: \"{{ php_fpm_tmp_upload_diectory }}\"\n    php_admin_value:\n      date.timezone: \"Europe/Berlin\"\n      log_errors: 'on'\n      max_execution_time: 300\n      memory_limit: 512M\n      upload_max_filesize: 32M\n```\n\n### php modules\n\n```yaml\nphp_modules:\n  # gd\n  - name: gd\n    enabled: true\n    priority: 20\n    content: |\n      extension=gd\n  # OpCache settings\n  - name: opcache\n    enabled: true\n    priority: 10\n    content: |\n      zend_extension=opcache\n      opcache.enable=1\n      opcache.enable_cli=1\n      opcache.memory_consumption=128\n      opcache.interned_strings_buffer=16\n      opcache.max_accelerated_files=10000\n      opcache.max_wasted_percentage=5\n      opcache.validate_timestamps=1\n      opcache.revalidate_path=0\n      opcache.revalidate_freq=1\n      opcache.max_file_size=0\n  # PDO mysql\n  - name: pdo_mysql\n    enabled: true\n    priority: 20\n    content: |\n      extension=pdo_mysql\n```\n\nUnder [documentation](documentation) you can find some module configurations that have been copied from php.ini.\n\n---\n\n## Contribution\n\nPlease read [Contribution](CONTRIBUTING.md)\n\n## Development,  Branches (Git Tags)\n\nThe `master` Branch is my *Working Horse* includes the \"latest, hot shit\" and can be complete broken!\n\nIf you want to use something stable, please use a [Tagged Version](https://github.com/bodsch/ansible-php/tags)!\n\n---\n\n## Author\n\n- Bodo Schulz\n\n## License\n\n[Apache](LICENSE)\n\n**FREE SOFTWARE, HELL YEAH!**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbodsch%2Fansible-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbodsch%2Fansible-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbodsch%2Fansible-php/lists"}