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

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
主站蜘蛛池模板: 和硕县| 阿拉善左旗| 德昌县| 长阳| 九台市| 嵩明县| 大邑县| 吴桥县| 随州市| 乌海市| 垫江县| 玉树县| 兖州市| 东丽区| 南京市| 宜良县| 延长县| 宣汉县| 竹北市| 文登市| 阿巴嘎旗| 孟州市| 濮阳市| 凤山县| 松桃| 双鸭山市| 富裕县| 图们市| 齐河县| 荆州市| 陆河县| 通海县| 曲沃县| 军事| 霍林郭勒市| 卓尼县| 鹿泉市| 晋宁县| 永修县| 徐水县| 来宾市|