Re: getting php to do an exec()
From: clvrmnky (clvrmnky-uunet_at_coldmail.com.invalid)
Date: 11/24/03
- Previous message: Marco S Hyman: "Re: confusion with the pf filter rule syntax"
- In reply to: DejaVU: "getting php to do an exec()"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 24 Nov 2003 17:22:58 -0500
DejaVU wrote:
> Hiya all
>
> Battling here a bit, being in a hurry to get this working
>
> Loaded 3.4 on a SPARC 5 yesterday
> Configured Apache
> Loaded PHP core 4.3.3
> modified httpd.conf to parse .html files
>
> I have transferred the pages I need to this server, and it serves
> them, BUT the php script I've been using on my FreeBSD box won't work
> because the critical call
> exec("ls -1", $files)
> fails
>
> On my FreeBSD box (shortly to lose it's hardware, like hours away)
> this works just fine, getting the current directory listing. That is
> running FreBSD5.0-RELEASE with Apache 2 and PHP 4.2.3 (all from the
> ports collection at the time of install a few months back).
>
> I cannot recall changing anything to make the exec() work, have not
> noted it in my server log, and cannot find any of my usual 'i changed
> this' tags in the ini files
>
> How do I get this to work quickly?
Might try comp.lang.php, as this is definitely a PHP/Apache issue, not
an OS issue (specifically).
However, the first thing I'd do is make sure it isn't a pathing problem.
Try an absolute path. The following works for me:
$fortune = exec("/usr/games/fortune -s", $fortunearray);
if ($fortune == "")
$fortunearray = array ("You have no fortune." );
I've heard that recent installs of Apache on OBSD are now chroot'd. If
this is so, the PHP module is running in the httpd environment, and may
see "/var/www" as "/". So, unless you have a local "ls", you may be SOL.
- Previous message: Marco S Hyman: "Re: confusion with the pf filter rule syntax"
- In reply to: DejaVU: "getting php to do an exec()"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|