How to run php-fpm as root

后端 未结 2 962
暖寄归人
暖寄归人 2021-02-19 00:55

I know the risks about running php-fpm as root. However there are situations where one would need to do it, like appliances, accessing operating system resources or ev

2条回答
  •  我寻月下人不归
    2021-02-19 01:51

    Update 2018

    Running it within a container is a possible valid reason to run php-fpm as root. It can be done by passing the -R command line argument to it


    Original answer:

    However there are situations where one would need to do it, like appliances, accessing operating system resources

    You never need to do it. That's it. If you are managing system resources, grant permissions for the php-fpm user to that resources rather than running the whole process as root. If your question would be more specific I could show how to do that in a certain situation.

提交回复
热议问题