Run php as user

Started by Mazaykina, Jul 07, 2022, 02:28 AM

Previous topic - Next topic

MazaykinaTopic starter

Hello, share your options for running php as a user in Apache
except php like cgi


SUPHP - start PHP as a separate user

Like the existing suexec extension for Apache, there is also a suphp solution for PHP that allows you to run PHP as an individual user or group that owns a particular website on shared hosting.

My opinion: mod_suphp is a cross between mod_php and php_cgi, but it has the following advantages over php_cgi
1.Htaccess directives are processed
2. Child threads are not created when processing your scripts.
But there are also disadvantages, in case of the slightest error in the script, a 500 error will simply fall out, and if everything works in mod_php mode, then the script will not work in suphp.
It has to do with processing.


You can call a PHP script in different ways: independently when working over SSH by calling the script with a utility, accessing the script directly via a link from your browser or through the Cron scheduler.
I advise you to implement that for the first time through the support of your web hosting with the indication of a specific script: so that specialists can more clearly understand the task and be able to prompt more accurately.