Welcome to Centmin Mod Community
Register Now

PHP-FPM What permisions phpfpm is using?

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by pamamolf, Dec 22, 2016.

  1. pamamolf

    pamamolf Well-Known Member

    2,724
    243
    63
    May 31, 2014
    Ratings:
    +434
    Local Time:
    9:19 AM
    Nginx-1.13.x
    MariaDB 10.1.x
    Hi :)

    Creating a folder using php has root permissions :(

    Any ideas how to automate permissions to nginx:nginx for the new generated folders/files using a php file?

    Thank you
     
    Last edited: Dec 22, 2016
  2. eva2000

    eva2000 Administrator Staff Member

    30,170
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,138
    Local Time:
    4:19 PM
    Nginx 1.13.x
    MariaDB 5.5
    AFAIK, it shouldn't php created files should be nginx permission based if the php script executing has nginx permissions. But if you as root user ran php script, then that would have root permissions. In which case you just chown them.

    How is the php script executed/ran/called ? Does the script itself use nginx:nginx user/group permissions ?
     
  3. pamamolf

    pamamolf Well-Known Member

    2,724
    243
    63
    May 31, 2014
    Ratings:
    +434
    Local Time:
    9:19 AM
    Nginx-1.13.x
    MariaDB 10.1.x
    It is running using a cron and the permissions on php file are nginx:nginx
     
  4. eva2000

    eva2000 Administrator Staff Member

    30,170
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,138
    Local Time:
    4:19 PM
    Nginx 1.13.x
    MariaDB 5.5
    • Informative Informative x 1