How to set up file permissions for Laravel?

前端 未结 15 2496
忘了有多久
忘了有多久 2020-11-22 00:08

I\'m using Apache Web Server that has the owner set to _www:_www. I never know what is the best practice with file permissions, for example when I create new La

15条回答
  •  我在风中等你
    2020-11-22 00:30

    I had the following configuration:

    • NGINX (running user: nginx)
    • PHP-FPM

    And applied permissions correctly as @bgies suggested in the accepted answer. The problem in my case was the php-fpm's configured running user and group which was originally apache.

    If you're using NGINX with php-fpm, you should open php-fpm's config file:

    nano /etc/php-fpm.d/www.config
    

    And replace user and group options' value with one NGINX is configured to work with; in my case, both were nginx:

    ... ; Unix user/group of processes ; Note: The user is mandatory. If the group is not set, the default user's group ; will be used. ; RPM: apache Choosed to be able to access some dir as httpd user = nginx ; RPM: Keep a group allowed to write in log dir. group = nginx ...

    Save it and restart nginx and php-fpm services.

提交回复
热议问题