Skip to content
Snippets Groups Projects
Commit 1b862162 authored by jurgenhaas's avatar jurgenhaas
Browse files

Generalize PHP config

parent 5bf2efa0
No related branches found
No related tags found
No related merge requests found
php_called_from_apache: false php_called_from_apache: false
php_needs_oci8: false php_repositories: []
php_conf_dir: 'conf.d' php_packages:
- php-apc
- php-pear
- php-soap
- php5
- php5-cgi
- php5-curl
- php5-dev
- php5-fpm
- php5-gd
- php5-imagick
- php5-imap
- php5-mcrypt
- php5-mysql
- php5-xdebug
- php5-xmlrpc
- imagemagick
php_allow_call_time_pass_reference: 'on' php_allow_call_time_pass_reference: 'on'
php_max_execution_time: '30' php_browscap: false
php_max_input_vars: '1000' php_conf_dir: 'conf.d'
php_memory_limit: '32M' php_date_timezone: 'Europe/Berlin'
php_display_errors: 'Off' php_display_errors: 'Off'
php_display_startup_errors: 'Off' php_display_startup_errors: 'Off'
php_error_reporting: 'E_ALL & ~E_NOTICE' php_error_reporting: 'E_ALL & ~E_NOTICE'
php_expose_php: 'Off'
php_filter_default: 'unsafe_raw' php_filter_default: 'unsafe_raw'
php_html_errors: 'Off' php_html_errors: 'Off'
php_log_errors: 'On' php_log_errors: 'On'
php_magic_quotes_gpc: 'On' php_magic_quotes_gpc: 'On'
php_max_execution_time: '30'
php_max_input_vars: '1000'
php_memory_limit: '32M'
php_needs_oci8: false
php_post_max_size: '32M' php_post_max_size: '32M'
php_upload_max_filesize: '2M'
php_date_timezone: 'Europe/Berlin'
php_register_globals: 'Off' php_register_globals: 'Off'
php_register_long_arrays: 'On' php_register_long_arrays: 'On'
php_sendmail_path: ''
php_session_cache_expire: '180'
php_session_cookie_lifetime: '0' php_session_cookie_lifetime: '0'
php_session_gc_divisor: '1000' php_session_gc_divisor: '1000'
php_session_gc_maxlifetime: '1440' php_session_gc_maxlifetime: '1440'
php_session_cache_expire: '180'
php_expose_php: 'Off'
php_browscap: false
php_sendmail_path: ''
php_short_open_tag: 'Off' php_short_open_tag: 'Off'
php_upload_max_filesize: '2M'
# apc.ini # apc.ini
apc_rfc1867: '1' apc_rfc1867: '1'
...@@ -32,6 +51,10 @@ apc_shm_size: '256M' ...@@ -32,6 +51,10 @@ apc_shm_size: '256M'
apc_shm_segments: '1' apc_shm_segments: '1'
apc_num_files_hint: '0' apc_num_files_hint: '0'
# opcache.ini
opcache_memory_consumption: '128'
opcache_max_accelerated_files: '10000'
# php 5.3 # php 5.3
php53: php53:
libraries: libraries:
......
--- ---
# file: roles/php/tasks/php.yml # file: roles/php/tasks/php.yml
- name: "PHP | Apt Repository"
apt_repository:
repo='{{ item }}'
state='present'
with_items: '{{ php_repositories }}'
- name: "PHP | Install required packages." - name: "PHP | Install required packages."
apt: apt:
pkg={{ item }} pkg={{ item }}
state=installed state=installed
with_items: with_items: '{{ php_packages }}'
- php5
- php-apc
- php-soap
- php5-cgi
- php5-mysql
- php5-xmlrpc
- php5-gd
- php5-imagick
- php5-mcrypt
- php5-imap
- php5-curl
- php5-xdebug
- php5-dev
- php-pear
- imagemagick
notify: notify:
- "PHP | Restart Apache" - "PHP | Restart Apache"
- name: "PHP | Enable Apache modules"
apache2_module:
name={{ item }}
state=present
with_items:
- fcgid
when: not php_called_from_apache
notify: "PHP | Restart Apache"
- name: "PHP | Configuration file, php.ini" - name: "PHP | Configuration file, php.ini"
template: template:
src=etc-php5-apache2-php.ini src=etc-php5-apache2-php.ini
...@@ -73,6 +55,16 @@ ...@@ -73,6 +55,16 @@
notify: notify:
- "PHP | Restart Apache" - "PHP | Restart Apache"
- name: "PHP | Cache configuration file, opcache.ini"
template:
src=etc-php5-conf-d-opcache.ini
dest=/etc/php5/{{ php_conf_dir }}/opcache.ini
owner=root
group=root
mode=0644
notify:
- "PHP | Restart Apache"
- name: "PHP | Create extra directory for browscap" - name: "PHP | Create extra directory for browscap"
file: file:
dest=/etc/php5/apache2/extra dest=/etc/php5/apache2/extra
...@@ -87,7 +79,7 @@ ...@@ -87,7 +79,7 @@
dest=/etc/php5/apache2/extra/browscap.ini dest=/etc/php5/apache2/extra/browscap.ini
owner=root owner=root
group=root group=root
when: not php_called_from_apache and php_browscap when: php_browscap
notify: notify:
- "PHP | Restart Apache" - "PHP | Restart Apache"
......
zend_extension=opcache.so
opcache.memory_consumption={{ opcache_memory_consumption }}
opcache.max_accelerated_files={{ opcache_max_accelerated_files }}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment