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

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
主站蜘蛛池模板: 田东县| 庆云县| 蕉岭县| 黄浦区| 宽甸| 嘉义市| 日土县| 扶风县| 横山县| 边坝县| 焦作市| 旌德县| 正蓝旗| 旺苍县| 靖宇县| 云浮市| 汝州市| 新巴尔虎左旗| 永济市| 台北县| 沭阳县| 河池市| 博野县| 湄潭县| 武乡县| 利川市| 鹿泉市| 郸城县| 类乌齐县| 清水河县| 托里县| 根河市| 婺源县| 澄迈县| 特克斯县| 沙河市| 阳泉市| 家居| 双辽市| 黎城县| 泾川县|