Skip to content
Snippets Groups Projects
Commit 8d760fee authored by jurgenhaas's avatar jurgenhaas
Browse files

Prepare for Ubuntu 16.04 with PHP 7

parent dbca52a1
No related branches found
No related tags found
No related merge requests found
php_called_from_apache: false
php_install_redis: true php_install_redis: true
php_repositories: [] php_repositories: []
php_packages: php_packages:
...@@ -19,9 +18,11 @@ php_packages: ...@@ -19,9 +18,11 @@ php_packages:
- php5-xmlrpc - php5-xmlrpc
- imagemagick - imagemagick
php_base_dir: 'php5'
php_conf_dir: 'conf.d'
php_allow_call_time_pass_reference: 'on' php_allow_call_time_pass_reference: 'on'
php_browscap: false php_browscap: false
php_conf_dir: 'conf.d'
php_date_timezone: 'Europe/Berlin' php_date_timezone: 'Europe/Berlin'
php_display_errors: 'Off' php_display_errors: 'Off'
php_display_startup_errors: 'Off' php_display_startup_errors: 'Off'
......
---
# file: roles/php/handlers/php.yml
- name: "PHP | Restart Apache"
debug: msg="Need to restart Apache server"
when: php_called_from_apache
changed_when: php_called_from_apache
notify:
- "Apache | Restart Apache"
---
dependencies:
- { role: apache }
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
- name: "PHP | OCI | Enable OCI for PHP" - name: "PHP | OCI | Enable OCI for PHP"
copy: copy:
content='extension={{ item }}.so' content='extension={{ item }}.so'
dest=/etc/php5/{{ php_conf_dir }}/{{ item }}.ini dest=/etc/{{ php_base_dir }}/{{ php_conf_dir }}/{{ item }}.ini
owner=root owner=root
group=root group=root
mode=0644 mode=0644
......
...@@ -13,18 +13,25 @@ ...@@ -13,18 +13,25 @@
state=installed state=installed
with_items: '{{ php_packages }}' with_items: '{{ php_packages }}'
notify: notify:
- "PHP | Restart Apache" - "Apache | Restart Apache"
- name: "PHP | Ensure Apache config directory"
file:
dest=/etc/{{ php_base_dir }}/apache2
state=directory
owner=root
group=root
mode=0755
- 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
dest=/etc/php5/apache2/php.ini dest=/etc/{{ php_base_dir }}/apache2/php.ini
owner=root owner=root
group=root group=root
mode=0644 mode=0644
when: not php_called_from_apache
notify: notify:
- "PHP | Restart Apache" - "Apache | Restart Apache"
- include: php53.yml - include: php53.yml
when: php_version|default('5.5') == '5.3' when: php_version|default('5.5') == '5.3'
...@@ -36,33 +43,32 @@ ...@@ -36,33 +43,32 @@
owner=root owner=root
group=root group=root
mode=0644 mode=0644
when: not php_called_from_apache
notify: notify:
- "PHP | Restart Apache" - "Apache | Restart Apache"
- name: "PHP | Cache configuration file, apc.ini" - name: "PHP | Cache configuration file, apc.ini"
template: template:
src=etc-php5-conf-d-apc.ini src=etc-php5-conf-d-apc.ini
dest=/etc/php5/{{ php_conf_dir }}/apc.ini dest=/etc/{{ php_base_dir }}/{{ php_conf_dir }}/apc.ini
owner=root owner=root
group=root group=root
mode=0644 mode=0644
notify: notify:
- "PHP | Restart Apache" - "Apache | Restart Apache"
- name: "PHP | Cache configuration file, opcache.ini" - name: "PHP | Cache configuration file, opcache.ini"
template: template:
src=etc-php5-conf-d-opcache.ini src=etc-php5-conf-d-opcache.ini
dest=/etc/php5/{{ php_conf_dir }}/opcache.ini dest=/etc/{{ php_base_dir }}/{{ php_conf_dir }}/opcache.ini
owner=root owner=root
group=root group=root
mode=0644 mode=0644
notify: notify:
- "PHP | Restart Apache" - "Apache | 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/{{ php_base_dir }}/apache2/extra
state=directory state=directory
owner=root owner=root
group=root group=root
...@@ -71,12 +77,12 @@ ...@@ -71,12 +77,12 @@
- name: "PHP | browscap.ini" - name: "PHP | browscap.ini"
copy: copy:
src=browscap.ini src=browscap.ini
dest=/etc/php5/apache2/extra/browscap.ini dest=/etc/{{ php_base_dir }}/apache2/extra/browscap.ini
owner=root owner=root
group=root group=root
when: php_browscap when: php_browscap
notify: notify:
- "PHP | Restart Apache" - "Apache | Restart Apache"
- name: "PHP | Enable PHP modules" - name: "PHP | Enable PHP modules"
shell: php5enmod {{ item }} shell: php5enmod {{ item }}
...@@ -84,9 +90,9 @@ ...@@ -84,9 +90,9 @@
- mcrypt - mcrypt
- imap - imap
- imagick - imagick
when: php_conf_dir == 'mods-available' when: php_version|default('5.5') != '7' and php_conf_dir == 'mods-available'
notify: notify:
- "PHP | Restart Apache" - "Apache | Restart Apache"
- name: "PHP | Create htdocs directory for apc status" - name: "PHP | Create htdocs directory for apc status"
file: file:
...@@ -109,7 +115,7 @@ ...@@ -109,7 +115,7 @@
ignore_errors: yes ignore_errors: yes
changed_when: oci_available.stdout != '/usr/lib/php5/20090626/pdo_oci.so' changed_when: oci_available.stdout != '/usr/lib/php5/20090626/pdo_oci.so'
notify: notify:
- "PHP | Restart Apache" - "Apache | Restart Apache"
- include: oci.yml - include: oci.yml
when: repository is defined and php_needs_oci8 and oci_available.stdout != '/usr/lib/php5/20090626/pdo_oci.so' when: repository is defined and php_needs_oci8 and oci_available.stdout != '/usr/lib/php5/20090626/pdo_oci.so'
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
dest='{{ item }}' dest='{{ item }}'
state='directory' state='directory'
with_items: with_items:
- '/etc/php5/fpm/pool.d/' - '/etc/{{ php_base_dir }}/fpm/pool.d/'
- name: "Check PHP 5.3 Requirement" - name: "Check PHP 5.3 Requirement"
shell: php --version shell: php --version
...@@ -134,7 +134,7 @@ ...@@ -134,7 +134,7 @@
- name: "Create PHP53 INI Files" - name: "Create PHP53 INI Files"
template: template:
src='etc-php5-apache2-php.ini' src='etc-php5-apache2-php.ini'
dest='/etc/php5/{{ item }}/php.ini' dest='/etc/{{ php_base_dir }}/{{ item }}/php.ini'
owner='root' owner='root'
group='root' group='root'
mode='644' mode='644'
......
...@@ -14,8 +14,8 @@ prefix=/usr/local ...@@ -14,8 +14,8 @@ prefix=/usr/local
exec_prefix=${prefix} exec_prefix=${prefix}
php_fpm_BIN=${exec_prefix}/sbin/php-fpm php_fpm_BIN=${exec_prefix}/sbin/php-fpm
php_fpm_CONF=/etc/php5/fpm/php-fpm.conf php_fpm_CONF=/etc/{{ php_base_dir }}/fpm/php-fpm.conf
php_fpm_INI=/etc/php5/fpm/php.ini php_fpm_INI=/etc/{{ php_base_dir }}/fpm/php.ini
php_fpm_PID=/var/run/php5-fpm.pid php_fpm_PID=/var/run/php5-fpm.pid
php_opts="-c $php_fpm_INI --fpm-config $php_fpm_CONF --pid $php_fpm_PID" php_opts="-c $php_fpm_INI --fpm-config $php_fpm_CONF --pid $php_fpm_PID"
......
...@@ -1349,7 +1349,7 @@ bcmath.scale = 0 ...@@ -1349,7 +1349,7 @@ bcmath.scale = 0
; http://php.net/browscap ; http://php.net/browscap
;browscap = extra/browscap.ini ;browscap = extra/browscap.ini
{% if php_browscap %} {% if php_browscap %}
browscap = /etc/php5/apache2/extra/browscap.ini browscap = /etc/{{ php_base_dir }}/apache2/extra/browscap.ini
{% endif %} {% endif %}
[Session] [Session]
......
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