Answer the question
In order to leave comments, you need to log in
How to run selected php script as root in Nginx?
Greetings.
There is a script (based on this one ) that checks the availability of the server by means of a ping. But the problem is that the script uses RAW sockets, which is only allowed by root.
This is the question, how to configure Nginx so that a specific script runs as root? By itself, Nginx runs on behalf of a user created specifically for it.
Thank you.
PS Actually, the task is to check the availability of the selected server and it is not necessary to solve it in this way, but calling system programs from php (they offered system("ping ".$_GET[adres]) and the like) seemed to me not very reasonable.
Answer the question
In order to leave comments, you need to log in
The point here is not who nginx is running under, as I understand it, but who php is running under. If you are using php-fpm, then you can create a separate pool under root, on a separate port or socket, and bind location in nginx to it. Google something like "multiple PHP-FPM pools", for example .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question