Newer
Older
---
# file: roles/php/tasks/php.yml
- name: "PHP | Install required packages."
apt:
pkg={{ item }}
state=installed
with_items:
- php5
- php-apc
- php-soap
- php5-mcrypt
- php5-imap
- php5-curl
- php5-xdebug
- php5-dev
- php-pear
notify:
- "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"
template:
src=etc-php5-apache2-php.ini
dest=/etc/php5/apache2/php.ini
owner=root
group=root
mode=0644
notify:
- "PHP | Restart Apache"
- include: php53.yml
when: php_version|default('5.5') == '5.3'
- name: "PHP | Configuration file, fcgid.conf"
template:
src=fcgid.conf
dest=/etc/apache2/mods-available/fcgid.conf
owner=root
group=root
mode=0644
notify:
- "PHP | Restart Apache"
# TODO: Upgrade APCu on Ubuntu 14.04
# @see https://github.com/owncloud/core/issues/14175#issuecomment-74573088
# wget https://launchpad.net/~ondrej/+archive/ubuntu/php5/+build/6149263/+files/php5-apcu_4.0.6-1%2Bdeb.sury.org~utopic%2B1_amd64.deb
# sudo dpkg -i php5-apcu_4.0.6-1+deb.sury.org~utopic+1_amd64.deb
- name: "PHP | Cache configuration file, apc.ini"
template:
src=etc-php5-conf-d-apc.ini
dest=/etc/php5/{{ php_conf_dir }}/apc.ini
owner=root
group=root
mode=0644
notify:
- "PHP | Restart Apache"
- name: "PHP | Create extra directory for browscap"
file:
dest=/etc/php5/apache2/extra
state=directory
owner=root
group=root
when: php_browscap
- name: "PHP | browscap.ini"
copy:
src=browscap.ini
dest=/etc/php5/apache2/extra/browscap.ini
owner=root
group=root
notify:
- "PHP | Restart Apache"
- name: "PHP | Enable PHP modules"
shell: php5enmod {{ item }}
with_items:
- mcrypt
- imap
notify:
- "PHP | Restart Apache"
- name: "PHP | Create htdocs directory for apc status"
file:
dest=/var/www/apc
state=directory
owner=www-data
group=www-data
- name: "PHP | Copy APC status php script"
copy:
src=apc.php
dest=/var/www/apc
owner=www-data
group=www-data
- name: "PHP | Check OCI Requirement"
shell: ls /usr/lib/php5/20090626/pdo_oci.so
register: oci_available
when: php_needs_oci8
ignore_errors: yes
changed_when: oci_available.stdout != '/usr/lib/php5/20090626/pdo_oci.so'
notify:
- "PHP | Restart Apache"
- include: oci.yml
when: repository is defined and php_needs_oci8 and oci_available.stdout != '/usr/lib/php5/20090626/pdo_oci.so'