Unable to fork

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
nolanpro
Forum Newbie
Posts: 17
Joined: Fri May 12, 2006 5:17 pm

Unable to fork

Post 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!!!
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post 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?
nolanpro
Forum Newbie
Posts: 17
Joined: Fri May 12, 2006 5:17 pm

Post 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.
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

I see... well I wish I could help, but I have never even used the exec function. :(
nolanpro
Forum Newbie
Posts: 17
Joined: Fri May 12, 2006 5:17 pm

Post by nolanpro »

Thanks anyway for your time :)
nolanpro
Forum Newbie
Posts: 17
Joined: Fri May 12, 2006 5:17 pm

Post 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.
Post Reply