CarlosLongarela.php7
Ansible Role: PHP 7.x (for PHP 7.2 and above)
This role installs and configures PHP 7.x using PHP-FPM.
Requirements
There are no requirements.
Role Variables
You can change these variables in your configuration:
php_version
: Default is 7.2.php_fpm_daemon
: Set to "php{{ php_version }}-fpm".
PHP Modules to Install:
php{{ php_version }}-bz2
php{{ php_version }}-curl
php{{ php_version }}-gd
php{{ php_version }}-json
php{{ php_version }}-mbstring
php{{ php_version }}-mysql
php{{ php_version }}-readline
php{{ php_version }}-recode
php{{ php_version }}-tidy
php{{ php_version }}-xml
php{{ php_version }}-xsl
php{{ php_version }}-zip
php{{ php_version }}-opcache
php-imagick
Other PHP Settings:
php_max_input_vars
: 1000php_memory_limit
: 512Mphp_display_errors
: Offphp_post_max_size
: 48Mphp_upload_max_filesize
: 12Mphp_max_file_uploads
: 20php_date_timezone
: Europe/Madridphp_max_execution_time
: 30 secondsphp_max_input_time
: 60 secondsphp_opcache_enable
: Enabled (1)php_opcache_memory_consumption
: 64php_opcache_max_accelerated_files
: 2000php_opcache_revalidate_freq
: 2php_opcache_interned_strings_buffer
: 8
PHP-FPM Configuration:
php_fpm_pid
: "/run/php/php{{ php_version }}-fpm.pid"php_fpm_error_log
: "/var/log/php{{ php_version }}-fpm.log"php_fpm_process_max
: 128php_fpm_pool_name
: webphp_fpm_pool_user
: www-dataphp_fpm_pool_group
: www-dataphp_fpm_pool_mode
: "0660"php_fpm_pool_listen
: "/run/php/php{{ php_version }}-fpm.sock"php_fpm_pool_max_children
: 10php_fpm_pool_start_servers
: 5php_fpm_pool_min_spare_servers
: 3php_fpm_pool_max_spare_servers
: 6
Dependencies
There are no dependencies.
Example Playbook
Here’s a simple example of how to use this role:
- hosts: servers
gather_facts: no
become: true
vars:
php_max_input_vars: 1000
php_memory_limit: 512M
php_display_errors: Off
php_post_max_size: 48M
php_upload_max_filesize: 12M
php_max_file_uploads: 20
php_date_timezone: Europe/Madrid
php_max_execution_time: 30
php_max_input_time: 60
php_opcache_enable: 1
roles:
- { role: CarlosLongarela.php }
License
This role is licensed under GPLv3.
Author Information
This role was created in May 2017 by Carlos Longarela from Taberna WordPress.
Installa
ansible-galaxy install CarlosLongarela.php7
Licenza
Unknown
Download
91
Proprietario
Husband, father, geek... Photography magazine @fotodng creator. Freelance WordPress developer and consultant at @codeablehq and https://tabernawp.com