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