Join the community today
Become a Member

PHP-FPM What permisions phpfpm is using?

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

  1. pamamolf

    pamamolf Premium Member Premium Member

    4,101
    428
    83
    May 31, 2014
    Ratings:
    +837
    Local Time:
    6:10 AM
    Nginx-1.26.x
    MariaDB 10.6.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

    55,245
    12,253
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,833
    Local Time:
    1:10 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    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 Premium Member Premium Member

    4,101
    428
    83
    May 31, 2014
    Ratings:
    +837
    Local Time:
    6:10 AM
    Nginx-1.26.x
    MariaDB 10.6.x
    It is running using a cron and the permissions on php file are nginx:nginx
     
  4. eva2000

    eva2000 Administrator Staff Member

    55,245
    12,253
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,833
    Local Time:
    1:10 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+