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

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
主站蜘蛛池模板: 锦州市| 扶风县| 包头市| 满城县| 焦作市| 治县。| 尼玛县| 镇安县| 锦州市| 大庆市| 南丰县| 瓮安县| 潞西市| 板桥市| 城步| 根河市| 达拉特旗| 嵊泗县| 凤阳县| 云浮市| 天柱县| 衡东县| 上高县| 龙南县| 巩义市| 长海县| 离岛区| 达日县| 阿坝县| 化州市| 纳雍县| 湖口县| 武平县| 阜新市| 彰化县| 大田县| 西昌市| 淮安市| 北票市| 汾西县| 河东区|