December 2017
Intermediate to advanced
364 pages
7h 30m
English
The following code snippet uses different modules to perform the installation of PHP and other required packages. Then it updates the PHP-FPM configuration using the replace module. Finally, it also updates the nginx configuration to update the PHP-FPM processing using the template module, and restarts the service to apply the changes:
- name: installing php apt: name: "{{ item }}" state: present update_cache: yes with_items: - php - php-curl - php-fpm - php-mysql - php-xmlrpc - name: configuring php.ini for php processor replace: path: /etc/php5/fpm/php.ini regex: ';cgi.fix_pathinfo=1' replace: 'cgi.fix_pathinfo=0' backup: yes- name: enable and restart the php fpm service service: name: php7.0-fpm enabled: ...