[PHP] External scripts in safe mode

2004-12-21 Thread Chadwin Tom

Hello

If this is an inappropriate place to seek help, many apologies, and where might 
I try?

I have a PHP 4.1.2 script on Red Hat (Apache 1.3.27) which calls an external 
script (Tidy, from tidy.sourceforge.net). It is called via popen() so that I 
can pipe through some arguments and receive the output. This worked fine until 
my ISP turned on safe mode. Now, although the UID of both the calling PHP 
script and of Tidy are the same, and though Tidy is sitting in a directory 
specified in safe_mode_exec_dir, the script fails.

Is there anything else I should be checking?

Thanks

Tom Chadwin

This email and its attachments are intended for the addressee only and may be
confidential or the subject of legal privilege. If this email and its 
attachments have
come to you in error,  you must take no action based on them, nor must you copy 
them,
distribute them or show them to anyone. Please contact the sender to notify us 
of the
error. 

Durham City Council accept no liability for, and shall not be legally bound by,
the contents of this email. No assurances are given as to the authority of the 
sender
to act on the Council's behalf and the views expressed within this email may 
not be
official Council policy but instead the personal views of the distributor.

This email and any attached files have been scanned for the presence of 
computer viruses
however, you are advised that Durham City Council bears no liability for 
attachments
and you therefore open any attachments at your own risk.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] External scripts in safe mode

2004-12-21 Thread Richard Lynch
Chadwin Tom wrote:
 If this is an inappropriate place to seek help, many apologies, and where
 might I try?

 I have a PHP 4.1.2 script on Red Hat (Apache 1.3.27) which calls an
 external script (Tidy, from tidy.sourceforge.net). It is called via
 popen() so that I can pipe through some arguments and receive the output.
 This worked fine until my ISP turned on safe mode. Now, although the UID
 of both the calling PHP script and of Tidy are the same, and though Tidy
 is sitting in a directory specified in safe_mode_exec_dir, the script
 fails.

 Is there anything else I should be checking?

Sometimes, a host re-compiles PHP, and turns on safe mode inadvertantly.

It should be noted that safe mode was designed to stop problems in PHP
CGI (not Module).  If they've turned it on for PHP as Module, they pretty
much are just causing users problems, and not gaining anything much in the
way of Security, as I understand it.  So maybe they can just re-compile
with Safe Mode OFF after confirming that it doesn't do squat in PHP as
Module -- Apache is already running as the under-powered user that Safe
Mode (sort of) emulates (in theory).

You know there is a Tidy PHP Module, right?  Maybe you could get your host
to install that, so you don't need popen and all that to run Tidy from the
shell.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php