RE: [PHP] Shell or http?

2001-08-27 Thread Jon Farmer

Shell PHP scripts will start with the line

#!/path/to/php -q

Regards

Jon

--
Jon Farmer  O?O¬
Systems Programmer, Entanet www.enta.net
Tel +44 (0)1952 428969 Mob +44 (0)7968 524175
PGP Key available, send blank email to [EMAIL PROTECTED]

-Original Message-
From: George E. Papadakis [mailto:[EMAIL PROTECTED]]
Sent: 26 August 2001 18:36
To: PHP List
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Shell or http?

2001-08-27 Thread Andrey Hristov

Note that I have problems with shellscripts written on Windows the SCP to Linux.
They don't run a t first time. So I've to open them with a editor(i prefer joe), 
remove Ms (newlines) after -q to ?php open tag.
After that everythings works fine.

Andrey Hristov
IcyGEN Corporation
http://www.icygen.com
99%

- Original Message -
From: Jon Farmer [EMAIL PROTECTED]
To: George E. Papadakis [EMAIL PROTECTED]; PHP List 
[EMAIL PROTECTED]
Sent: Monday, August 27, 2001 1:11 PM
Subject: RE: [PHP] Shell or http?


 Shell PHP scripts will start with the line

 #!/path/to/php -q

 Regards

 Jon

 --
 Jon Farmer  O?O¬
 Systems Programmer, Entanet www.enta.net
 Tel +44 (0)1952 428969 Mob +44 (0)7968 524175
 PGP Key available, send blank email to [EMAIL PROTECTED]

 -Original Message-
 From: George E. Papadakis [mailto:[EMAIL PROTECTED]]
 Sent: 26 August 2001 18:36
 To: PHP List
 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: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Shell or http?

2001-08-26 Thread Chris Lambert

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 - [EMAIL PROTECTED]
WhiteCrown Networks - More Than White Hats
Web Application Security - www.whitecrown.net
*/

- Original Message -
From: George E. Papadakis [EMAIL PROTECTED]
To: PHP List [EMAIL PROTECTED]
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: [EMAIL PROTECTED]
| For additional commands, e-mail: [EMAIL PROTECTED]
| To contact the list administrators, e-mail: [EMAIL PROTECTED]
|
|
|


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Shell or http?

2001-08-26 Thread George E. Papadakis

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 [EMAIL PROTECTED]
To: George E. Papadakis [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
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 - [EMAIL PROTECTED]
 WhiteCrown Networks - More Than White Hats
 Web Application Security - www.whitecrown.net
 */

 - Original Message -
 From: George E. Papadakis [EMAIL PROTECTED]
 To: PHP List [EMAIL PROTECTED]
 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: [EMAIL PROTECTED]
 | For additional commands, e-mail: [EMAIL PROTECTED]
 | To contact the list administrators, e-mail: [EMAIL PROTECTED]
 |
 |
 |


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]