T2L.php
Ansible Role: PHP
This role installs PHP on Ubuntu LTS using The main PPA for PHP.
Requirements
No requirements.
Role Variables
Here are the available variables and their default values (check defaults/main.yml for details):
PHP version to install:
php_version: '7.4'
PHP extensions to install. Just list the extension names without the PHP version, for example:
php_extensions: []
PHP configuration settings. PHP for Apache and CLI PHP need separate configurations:
php_configuration: {} php_cli_configuration: {}
PHP keeps its settings in INI files. The main php.ini
file has sections, with properties belonging to specific sections.
The configuration variables work similarly. It is a nested dictionary, where the first level is the section name, and the second level is a dictionary of PHP settings and their values.
Example:
php_configuration:
Date:
date.timezone: Europe/Kiev
PHP:
memory_limit: 256M
upload_max_filesize: 64M
post_max_size: 512M
For PHP extensions that have their own INI files, settings should be configured as well (not all extensions do this). Some extensions use the main php.ini for their settings (like opcache):
php_extensions_configuration: {}
This variable also follows a nested dictionary format, with the section representing the extension itself.
Example:
php_extensions_configuration:
ldap:
ldap.max_links: 5
xdebug:
xdebug.mode: 'debug'
Web server daemon. It will restart if there are configuration changes. Defaults to Apache 2:
php_web_server_daemon: apache2
Boolean value to indicate if the web server should restart:
php_restart_web_server: true
Dependencies
No dependencies.
Example Playbook
- hosts: all
roles:
- t2l.php
License
MIT
Author Information
This role was created by Roman Paska between 2017 and 2021.
Changelog
You can find the changelog here: CHANGELOG.md
ansible-galaxy install T2L.php