Page 1 of 1

Unable to fork

Posted: Fri Dec 01, 2006 11:47 am
by nolanpro
I’m trying to exec a php file from within another file but I get “Unable to Fork” and a bunch of weird looped data when run the a browser.

The strange thing, when the same script is run on the command line, it works fine.

FileOne.php:

Code: Select all

exec('php5 FileTwo.php5', $output); print_r($output);
FileTwo.php5

Code: Select all

echo "OK";
When I run FileOne.php from the command line, it works fine. Only doesnt work when I run it from the web.

Any help would be greatly appreciated. Thanks!!!

Posted: Fri Dec 01, 2006 11:53 am
by Luke
hmm... how come you can't just do this?

Code: Select all

include('FileTwo.php5');
are you running more than one version of php or something?

Posted: Fri Dec 01, 2006 12:16 pm
by nolanpro
Yup, two versions, long story short: hosting company doesn't know what their doing.

This example represents much larger scripts, some in 4 some in 5, the 5 needs to be 5 because of new functions, the 4 files (all 3k of them), might work in 5, but would have to rename all to .php5 AND rename all internal calls in them, a LOAD of trouble.

Posted: Fri Dec 01, 2006 12:20 pm
by Luke
I see... well I wish I could help, but I have never even used the exec function. :(

Posted: Fri Dec 01, 2006 1:27 pm
by nolanpro
Thanks anyway for your time :)

Posted: Fri Dec 01, 2006 4:43 pm
by nolanpro
I found a way around it for my purposes only, all 3000+ files are just includes in index.php, so I just added a shebang #! with a path to php5 and put that in index.php and everything is good.