Skip to content

Commit

Permalink
fix: 修复 libzip 目录权限
Browse files Browse the repository at this point in the history
该目录权限为root, 会导致以非root用户启动php-fpm后找没权限加载libzip.so文件的问题
  • Loading branch information
daixijun committed Apr 20, 2020
1 parent f0db6e1 commit ab4125c
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
state: directory
owner: "{{ php_web_user }}"
group: "{{ php_web_user }}"
recurse: True
mode: "755"
loop:
- "{{ php_log_path }}"
Expand All @@ -104,24 +105,28 @@
template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
owner: "{{ php_web_user }}"
group: "{{ php_web_user }}"
loop:
- src: php.ini.j2
dest: /usr/local/php-{{ php_version }}/etc/php.ini
- src: php-fpm.conf.j2
dest: /usr/local/php-{{ php_version }}/etc/php-fpm.conf
- src: www.conf.j2
dest: /usr/local/php-{{ php_version }}/etc/php-fpm.d/www.conf
diff: true
notify:
- restart php-fpm

- name: Ensure directory permissions
file:
path: /usr/local/php-{{ php_version }}
path: "{{ item }}"
state: directory
owner: "{{ php_web_user }}"
group: "{{ php_web_user }}"
recurse: yes
loop:
- /usr/local/libzip
- /usr/local/php-{{ php_version }}

- name: Symlink
file:
Expand All @@ -136,14 +141,8 @@
template:
src: php-fpm.service.j2
dest: /usr/lib/systemd/system/php-fpm.service
diff: true

- name: Ensure php-fpm.service started
systemd:
name: php-fpm.service
state: started
enabled: yes
daemon_reload: yes
notify:
- restart php-fpm

- import_tasks: post_task.yaml

Expand Down

0 comments on commit ab4125c

Please sign in to comment.