Re: [PHP] exec problems

2001-12-10 Thread Brian Clark

* J. Heffner ([EMAIL PROTECTED]) [Dec 10. 2001 20:06]:

> I need to write a script that will stuff the names of all the files 
> in a directory into an array, which I can then use for some 
> adminstrative processing. Seems easy enough:
> 
> exec ("ls", $fileArray, $isComplete);
> 
> This will run fine if I call the php file containing this code from 
> bash (using the php cgi), but not if I use it inside a php file 
> accessed via the web server. I'm running apache with suexec enabled 
> on a Redhat Linux box.
> 
> Looking in the error log revealed the following error:
> 
> /ls: No such file or directory

It is possible that your (host's?) server has safe_mode enabled and 
you or someone else has set safe_mode_exec_dir. Just a guess.



-- 
 -Brian Clark


-- 
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] exec problems

2001-12-10 Thread J. Heffner

Hello,

I need to write a script that will stuff the names of all the files 
in a directory into an array, which I can then use for some 
adminstrative processing. Seems easy enough:

exec ("ls", $fileArray, $isComplete);

This will run fine if I call the php file containing this code from 
bash (using the php cgi), but not if I use it inside a php file 
accessed via the web server. I'm running apache with suexec enabled 
on a Redhat Linux box.

Looking in the error log revealed the following error:

/ls: No such file or directory

I thought it might have something to do with the absence of a path 
name, so I added the fully qualified path to the command string, but 
unfortunately,  that didn't make any difference.  Php version is 
4.0.3pl1.

Thanks for your help.

jh

-- 
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]