Re: Shell or http?
| From: | Chris Lambert | Date: | Mon, 27 Aug 2001 00:13:24 +0000 |
| Subject: | Re: Shell or http? | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-64561@lists.php.net to get a copy of this message | ||
Look into:
http://www.php.net/manual/en/function.get-current-user.php
If run from the webserver it may return "nobody", and from your shell it'd
run as your username.
/* Chris Lambert, CTO - chris@whitecrown.net
WhiteCrown Networks - More Than White Hats
Web Application Security - www.whitecrown.net
*/
----- Original Message -----
From: George E. Papadakis <georgep@phaistosnetworks.gr>
To: Chris Lambert <chris@php.net>
Cc: <php-general@lists.php.net>
Sent: Sunday, August 26, 2001 6:51 PM
Subject: Re: [PHP] Shell or http?
| Thanks for your answer Chris,
|
| What I want to do is find a way to check if a script is running as a cgi
or
| not.
| Suppose I am running it from a unix shell (sgi) then I want the script to
| behave differently than when executed by a Web Server. I was wondering if
| there is an enviroment/php variable that can help me identify whether the
| script was sgi or web running.
| Thanks again.
|
| --georgep
|
| ----- Original Message -----
| From: "Chris Lambert" <chris@php.net>
| To: "George E. Papadakis" <georgep@phaistosnetworks.gr>
| Cc: <php-general@lists.php.net>
| Sent: Monday, August 27, 2001 1:14 AM
| Subject: Re: [PHP] Shell or http?
|
|
| > It depends on how the webserver is setup. If its being run as a CGI then
| it
| > depends if suEXEC is enabled. If its not, it should be run as nobody,
| > whereas if it is (and the user/group paramater in httpd.conf is set)
it'll
| > be run as whatever the directive is set to. If its run as a module, then
| the
| > userid should be nobody. Where are you trying to identify it from?
| >
| > /* Chris Lambert, CTO - chris@whitecrown.net
| > WhiteCrown Networks - More Than White Hats
| > Web Application Security - www.whitecrown.net
| > */
| >
| > ----- Original Message -----
| > From: George E. Papadakis <georgep@phaistosnetworks.gr>
| > To: PHP List <php-general@lists.php.net>
| > Sent: Sunday, August 26, 2001 1:36 PM
| > Subject: [PHP] Shell or http?
| >
| >
| > | Hi,
| > |
| > | Is there any way to identify if a php script is running through a
shell
| or
| > | web?
| > | Thanks in advance.
| > |
| > |
| > | -- GeorgeP
| > |
| > |
| > | --
| > | PHP General Mailing List (http://www.php.net/)
| > | To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
| > | For additional commands, e-mail: php-general-help@lists.php.net
| > | To contact the list administrators, e-mail:
php-list-admin@lists.php.net
| > |
| > |
| > |
| >
| >
| > --
| > PHP General Mailing List (http://www.php.net/)
| > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
| > For additional commands, e-mail: php-general-help@lists.php.net
| > To contact the list administrators, e-mail: php-list-admin@lists.php.net
| >
|
|
| --
| PHP General Mailing List (http://www.php.net/)
| To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
| For additional commands, e-mail: php-general-help@lists.php.net
| To contact the list administrators, e-mail: php-list-admin@lists.php.net
|
|
|