Skip to content

Commit

Permalink
Merge pull request #1052 from roots/php-7.3
Browse files Browse the repository at this point in the history
Update to PHP 7.3
  • Loading branch information
retlehs committed Dec 27, 2018
2 parents 60975e0 + 44839e3 commit 3a2f25d
Show file tree
Hide file tree
Showing 12 changed files with 39 additions and 38 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
@@ -1,4 +1,5 @@
### HEAD
* Update to PHP 7.3 ([#1052](https://github.com/roots/trellis/pull/1052))
* Enable per-user `update_password` behavior ([#767](https://github.com/roots/trellis/pull/767))
* Fix Vagrant trigger path ([#1051](https://github.com/roots/trellis/pull/1051))
* Fix: `vault_wordpress_env_defaults` not populated during deploy ([#1049](https://github.com/roots/trellis/pull/1049))
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -14,7 +14,7 @@ Trellis will configure a server with the following and more:

* Ubuntu 18.04 Bionic LTS
* Nginx (with optional FastCGI micro-caching)
* PHP 7.2
* PHP 7.3
* MariaDB (a drop-in MySQL replacement)
* SSL support (scores an A+ on the [Qualys SSL Labs Test](https://www.ssllabs.com/ssltest/))
* Let's Encrypt for free SSL certificates
Expand Down
2 changes: 1 addition & 1 deletion dev.yml
Expand Up @@ -6,7 +6,7 @@
roles:
- { role: python_interpreter, tags: [always] }

- name: "WordPress Server: Install LEMP Stack with PHP 7.2 and MariaDB MySQL"
- name: "WordPress Server: Install LEMP Stack with PHP 7.3 and MariaDB MySQL"
hosts: web:&development
become: yes
remote_user: vagrant
Expand Down
2 changes: 1 addition & 1 deletion group_vars/all/users.yml
Expand Up @@ -19,4 +19,4 @@ users:
web_user: web
web_group: www-data
web_sudoers:
- "/usr/sbin/service php7.2-fpm *"
- "/usr/sbin/service php7.3-fpm *"
2 changes: 1 addition & 1 deletion roles/common/handlers/main.yml
Expand Up @@ -9,7 +9,7 @@

- name: reload php-fpm
service:
name: php7.2-fpm
name: php7.3-fpm
state: reloaded

- import_tasks: reload_nginx.yml
2 changes: 1 addition & 1 deletion roles/deploy/hooks/finalize-after.yml
Expand Up @@ -34,6 +34,6 @@
when: wp_installed.rc == 0

- name: Reload php-fpm
shell: sudo service php7.2-fpm reload
shell: sudo service php7.3-fpm reload
args:
warn: false
24 changes: 12 additions & 12 deletions roles/php/defaults/main.yml
Expand Up @@ -2,18 +2,18 @@ disable_default_pool: true
memcached_sessions: false

php_extensions_default:
php7.2-cli: "{{ apt_package_state }}"
php7.2-common: "{{ apt_package_state }}"
php7.2-curl: "{{ apt_package_state }}"
php7.2-dev: "{{ apt_package_state }}"
php7.2-fpm: "{{ apt_package_state }}"
php7.2-gd: "{{ apt_package_state }}"
php7.2-mbstring: "{{ apt_package_state }}"
php7.2-mysql: "{{ apt_package_state }}"
php7.2-opcache: "{{ apt_package_state }}"
php7.2-xml: "{{ apt_package_state }}"
php7.2-xmlrpc: "{{ apt_package_state }}"
php7.2-zip: "{{ apt_package_state }}"
php7.3-cli: "{{ apt_package_state }}"
php7.3-common: "{{ apt_package_state }}"
php7.3-curl: "{{ apt_package_state }}"
php7.3-dev: "{{ apt_package_state }}"
php7.3-fpm: "{{ apt_package_state }}"
php7.3-gd: "{{ apt_package_state }}"
php7.3-mbstring: "{{ apt_package_state }}"
php7.3-mysql: "{{ apt_package_state }}"
php7.3-opcache: "{{ apt_package_state }}"
php7.3-xml: "{{ apt_package_state }}"
php7.3-xmlrpc: "{{ apt_package_state }}"
php7.3-zip: "{{ apt_package_state }}"

php_extensions_custom: {}
php_extensions: "{{ php_extensions_default | combine(php_extensions_custom) }}"
Expand Down
22 changes: 11 additions & 11 deletions roles/php/tasks/main.yml
@@ -1,38 +1,38 @@
---
- name: Add PHP 7.2 PPA
- name: Add PHP 7.3 PPA
apt_repository:
repo: "ppa:ondrej/php"
update_cache: yes

- name: Install PHP 7.2
- name: Install PHP 7.3
apt:
name: "{{ item.key }}"
state: "{{ item.value }}"
cache_valid_time: "{{ apt_cache_valid_time }}"
with_dict: "{{ php_extensions }}"

- name: Start php7.2-fpm service
- name: Start php7.3-fpm service
service:
name: php7.2-fpm
name: php7.3-fpm
state: started
enabled: true

- name: Check for existing php7.1-fpm service
- name: Check for existing php7.2-fpm service
stat:
path: /etc/init.d/php7.1-fpm
register: php71_status
path: /etc/init.d/php7.2-fpm
register: php72_status

- name: Stop php7.1-fpm service if it exists
- name: Stop php7.2-fpm service if it exists
service:
name: php7.1-fpm
name: php7.2-fpm
state: stopped
enabled: false
register: service_stopped
when: php71_status.stat.exists
when: php72_status.stat.exists
notify: reload php-fpm

- name: PHP configuration file
template:
src: php.ini.j2
dest: /etc/php/7.2/fpm/php.ini
dest: /etc/php/7.3/fpm/php.ini
notify: reload php-fpm
6 changes: 3 additions & 3 deletions roles/wordpress-setup/tasks/main.yml
Expand Up @@ -26,13 +26,13 @@
- name: Create WordPress php-fpm configuration file
template:
src: php-fpm.conf.j2
dest: /etc/php/7.2/fpm/pool.d/wordpress.conf
dest: /etc/php/7.3/fpm/pool.d/wordpress.conf
notify: reload php-fpm

- name: Disable default PHP-FPM pool
command: mv /etc/php/7.2/fpm/pool.d/www.conf /etc/php/7.2/fpm/pool.d/www.disabled
command: mv /etc/php/7.3/fpm/pool.d/www.conf /etc/php/7.3/fpm/pool.d/www.disabled
args:
creates: /etc/php/7.2/fpm/pool.d/www.disabled
creates: /etc/php/7.3/fpm/pool.d/www.disabled
when: disable_default_pool | default(true)
notify: reload php-fpm

Expand Down
10 changes: 5 additions & 5 deletions roles/xdebug/tasks/main.yml
Expand Up @@ -9,26 +9,26 @@
- name: Template the Xdebug configuration file
template:
src: xdebug.ini.j2
dest: /etc/php/7.2/mods-available/xdebug.ini
dest: /etc/php/7.3/mods-available/xdebug.ini
notify: reload php-fpm

- name: Ensure 20-xdebug.ini is present
file:
src: /etc/php/7.2/mods-available/xdebug.ini
dest: /etc/php/7.2/fpm/conf.d/20-xdebug.ini
src: /etc/php/7.3/mods-available/xdebug.ini
dest: /etc/php/7.3/fpm/conf.d/20-xdebug.ini
state: link
notify: reload php-fpm

when: xdebug_remote_enable | bool

- name: Disable Xdebug
file:
path: /etc/php/7.2/fpm/conf.d/20-xdebug.ini
path: /etc/php/7.3/fpm/conf.d/20-xdebug.ini
state: absent
when: not xdebug_remote_enable | bool
notify: reload php-fpm

- name: Disable Xdebug CLI
file:
path: /etc/php/7.2/cli/conf.d/20-xdebug.ini
path: /etc/php/7.3/cli/conf.d/20-xdebug.ini
state: absent
2 changes: 1 addition & 1 deletion server.yml
Expand Up @@ -16,7 +16,7 @@
roles:
- { role: python_interpreter, tags: [always] }

- name: WordPress Server - Install LEMP Stack with PHP 7.2 and MariaDB MySQL
- name: WordPress Server - Install LEMP Stack with PHP 7.3 and MariaDB MySQL
hosts: web:&{{ env }}
become: yes
roles:
Expand Down
2 changes: 1 addition & 1 deletion xdebug-tunnel.yml
Expand Up @@ -15,5 +15,5 @@
handlers:
- name: reload php-fpm
service:
name: php7.2-fpm
name: php7.3-fpm
state: reloaded

0 comments on commit 3a2f25d

Please sign in to comment.