官术网_书友最值得收藏!

Installing PHP for WordPress setup

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: yes
state: restarted

- name: update the nginx configuration to support php-fpm
template:
src: "{{ item.src }}"
dest: "{{ item.dst }}"

with_items:
- { src: "defautlt.conf.j2", dst: "/etc/nginx/conf.d/default.conf" }

- name: restart the nginx
service:
state: restarted
name: nginx
主站蜘蛛池模板: 青海省| 崇州市| 沽源县| 紫阳县| 隆德县| 宜君县| 竹山县| 宁晋县| 灌南县| 肥城市| 周宁县| 北京市| 胶南市| 囊谦县| 清苑县| 夏津县| 嘉义县| 镶黄旗| 克东县| 内丘县| 永宁县| 溆浦县| 兴和县| 济阳县| 金乡县| 阳高县| 西吉县| 濮阳县| 峨山| 钦州市| 鸡东县| 莎车县| 长阳| 万载县| 会昌县| 宜城市| 二连浩特市| 重庆市| 南丹县| 偏关县| 方正县|