exec() and PWS

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
Skorpion
Forum Newbie
Posts: 4
Joined: Sat May 11, 2002 7:50 am

exec() and PWS

Post by Skorpion »

Just out of curiosity, does PWS not allow any system script calls?

Using exec("perl /cgi-bin/myperlscript.pl") works fine on linux, but gets "unable to fork" under PWS.

So then I tried to let Windows know the full path to the script and to perl, as in:

exec("d:perlinperl.exe d:inetpubwwwrootcgi-binmyperlscript.pl");

Same result.
User avatar
EvilWalrus
Site Admin
Posts: 209
Joined: Thu Apr 18, 2002 3:21 pm
Location: Springmont, PA USA

Post by EvilWalrus »

check the manual for virtual()....
Skorpion
Forum Newbie
Posts: 4
Joined: Sat May 11, 2002 7:50 am

Post by Skorpion »

Is virtual not an Apache specific function?

I'm getting the error on PWS running on W98, not Apache.
User avatar
EvilWalrus
Site Admin
Posts: 209
Joined: Thu Apr 18, 2002 3:21 pm
Location: Springmont, PA USA

Post by EvilWalrus »

1) Get a new server platform... ditch Win98 and PWS and get Apache with at least Win2k... (linux is better)

2) read the manual on shell_exec()... it works perfectly on windows, and another thing... try double-backslashing your paths... \
Skorpion
Forum Newbie
Posts: 4
Joined: Sat May 11, 2002 7:50 am

Post by Skorpion »

1) Agreed. The actual server uses Apache on a linux platform. I'm just goofing around with PWS/W98 at home, and encountered this little exec() conundrum.

2) Good thought on shell_exec() - I missed that one. Now I get a new error message! At last - progress! :) "PHP has encountered an Access Violation at BFF7B992"

Hmmm...something to do with the php.ini file?

Or does everything come down to PWS...as in it sucks, and simply does not allow system calls? I'm thinking this is the real culprit. I've now read of others having some trouble with this, but was hoping some clever lad had discovered a work-around.

(Double back slashing does nothing new - ie same old "cannot fork").
Post Reply