Re: how to exec php script from php?

From: Date: Mon, 12 Jun 2000 15:29:41 +0000
Subject: Re: how to exec php script from php?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-1625@lists.php.net to get a copy of this message
> no, i want run it as new procces, like i can do it with the > system() command. Obviously you know that it is dangerous to have your webserver do your sysadmin stuff for you... Do you have php compiled as a cgi as well as a module? If so you could exec it just like you would do with the actual command. If you're talking about recompling Apache, you could leave apache alone and compile a cgi php binary, make a script with the first line #!/path/to/php -q and then in that script do all of the stuff that you wanted. Do not run it out of the cgi-bin, but instead just exec() or system() it from your script. Instead of using suExec, you could use SUID, or better yet SGID to give the script the permissions needed, and you could hide the script away anywhere on your server as opposed to somewhere near the webserver directory. Note: I should mention again that it is _not_ good to have your sysadmin stuff done from your webserver.

« previous php.general (#1625) next »