Skip to content

pabloguerino/ansible-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ansible Role: PHP

Installs PHP 8.3 (FPM) on Debian via Sury. Manages configuration for php.ini and php-fpm.conf.

Requirements

This role is designed for Debian-based systems.

Role Variables

Available variables are listed below, along with default values (see defaults/main.yml):

Packages

The list of packages to install. Defaults to a standard set of PHP 8.3 extensions.

php_packages:
  - php8.3-bcmath
  - php8.3-cgi
  - php8.3-cli
  - php8.3-common
  - php8.3-curl
  - php8.3-fpm
  - php8.3-gd
  - php8.3-intl
  - php8.3-mbstring
  - php8.3-mysql
  - php8.3-opcache
  - php8.3-pgsql
  - php8.3-sqlite3
  - php8.3-soap
  - php8.3-xml
  - php8.3-zip

General Configuration

php_timezone: America/Argentina/Buenos_Aires
php_upload_max_filesize: "20M"
php_post_max_size: "20M"
php_memory_limit: "512M"
php_max_execution_time: 60

Logging & Errors

php_errors: "On"
php_error_reporting: "E_ALL & ~E_DEPRECATED & ~E_STRICT"
php_log_level: "notice"
php_log_errors: "on"

PHP-FPM Configuration

Process manager settings and user/group definitions.

php_pm: "dynamic"
php_pm_max_children: 5
php_pm_start_servers: 2
php_pm_min_spare_servers: 1
php_pm_max_spare_servers: 3
php_pm_max_requests: 500

php_listen: "/run/php/php-fpm.sock"
php_user: "www-data"
php_group: "www-data"
php_log_file: "/var/log/fpm-php.www.log"

Dependencies

None.

Example Playbook

- hosts: webservers
  vars:
    php_memory_limit: "1024M"
    php_timezone: "UTC"
  roles:
    - { role: pabloguerino.ansible-php }

License

MIT / BSD

Author Information

This role was created in 2016 (updated in 2026 to support legacy projects) by Pablo Guerino.

About

PHP8+ (with fpm) for Debian

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages