Skip to content
This repository has been archived by the owner on Feb 13, 2023. It is now read-only.

Commit

Permalink
Update to latest version of PHP role.
Browse files Browse the repository at this point in the history
  • Loading branch information
geerlingguy committed Nov 16, 2016
1 parent a2e6b54 commit 96e0bc1
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 21 deletions.
2 changes: 1 addition & 1 deletion provisioning/requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
- src: geerlingguy.nodejs
version: 3.3.0
- src: geerlingguy.php
version: 3.3.3
version: 3.4.1
- src: geerlingguy.php-memcached
version: 2.0.0
- src: geerlingguy.php-mysql
Expand Down
3 changes: 3 additions & 0 deletions provisioning/roles/geerlingguy.php/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ Various defaults for PHP. Only used if `php_use_managed_ini` is set to `true`.

The OpCache is included in PHP starting in version 5.5, and the following variables will only take effect if the version of PHP you have installed is 5.5 or greater.

php_opcache_zend_extension: "opcache.so"
php_opcache_enable: "1"
php_opcache_enable_cli: "0"
php_opcache_memory_consumption: "96"
Expand All @@ -110,6 +111,8 @@ The OpCache is included in PHP starting in version 5.5, and the following variab

OpCache ini directives that are often customized on a system. Make sure you have enough memory and file slots allocated in the OpCache (`php_opcache_memory_consumption`, in MB, and `php_opcache_max_accelerated_files`) to contain all the PHP code you are running. If not, you may get less-than-optimal performance!

For custom opcache.so location provide full path with `php_opcache_zend_extension`.

php_opcache_conf_filename: [platform-specific]

The platform-specific opcache configuration filename. Generally the default should work, but in some cases, you may need to override the filename.
Expand Down
1 change: 1 addition & 0 deletions provisioning/roles/geerlingguy.php/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ php_fpm_pm_max_spare_servers: 5
php_executable: "php"

# OpCache settings (useful for PHP >=5.5).
php_opcache_zend_extension: "opcache.so"
php_opcache_enable: "1"
php_opcache_enable_cli: "0"
php_opcache_memory_consumption: "96"
Expand Down
7 changes: 7 additions & 0 deletions provisioning/roles/geerlingguy.php/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,23 @@
# Setup/install tasks.
- include: setup-RedHat.yml
when: (php_install_from_source == false) and (ansible_os_family == 'RedHat')
static: no

- include: setup-Debian.yml
when: (php_install_from_source == false) and (ansible_os_family == 'Debian')
static: no

# Install PHP from source when php_install_from_source is true.
- include: install-from-source.yml
when: php_install_from_source == true
static: no

# Configure PHP.
- include: configure.yml
static: no
- include: configure-apcu.yml
static: no
- include: configure-opcache.yml
static: no
- include: configure-fpm.yml
static: no
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
zend_extension=opcache.so
zend_extension={{ php_opcache_zend_extension }}
opcache.enable={{ php_opcache_enable }}
opcache.enable_cli={{ php_opcache_enable_cli }}
opcache.memory_consumption={{ php_opcache_memory_consumption }}
Expand Down
34 changes: 16 additions & 18 deletions provisioning/roles/geerlingguy.php/tests/test-vars-ubuntu1204.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
---
php_version: "5.6"
php_packages:
- php5
- php5-mcrypt
- php5-cli
- php5-common
- php5-curl
- php5-dev
- php5-fpm
- php5-gd
- php-pear
- php5.6
- php5.6-mcrypt
- php5.6-cli
- php5.6-common
- php5.6-curl
- php5.6-dev
- php5.6-fpm
- php5.6-gd
- libpcre3-dev
php_conf_paths:
- /etc/php5/fpm
- /etc/php5/apache2
- /etc/php5/cli
- /etc/php/5.6/fpm
- /etc/php/5.6/apache2
- /etc/php/5.6/cli
php_extension_conf_paths:
- /etc/php5/fpm/conf.d
- /etc/php5/apache2/conf.d
- /etc/php5/cli/conf.d
php_fpm_daemon: php5-fpm
php_fpm_conf_path: "/etc/php5/fpm"
- /etc/php/5.6/fpm/conf.d
- /etc/php/5.6/apache2/conf.d
- /etc/php/5.6/cli/conf.d
php_fpm_daemon: php5.6-fpm
php_fpm_conf_path: "/etc/php/5.6/fpm"
3 changes: 2 additions & 1 deletion provisioning/roles/geerlingguy.php/tests/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
php_enable_webserver: false
php_memory_limit: "192M"
php_enablerepo: "remi,remi-php70"
php_install_recommends: no

pre_tasks:
- name: Update apt cache.
Expand All @@ -19,7 +20,7 @@
when: ansible_distribution == 'Ubuntu' and ansible_distribution_version != '12.04'

- name: Add repository for PHP 5.6.
apt_repository: repo='ppa:ondrej/php5-5.6'
apt_repository: repo='ppa:ondrej/php'
when: ansible_distribution == 'Ubuntu' and ansible_distribution_version == '12.04'

roles:
Expand Down

0 comments on commit 96e0bc1

Please sign in to comment.