Heh heh....my syntax in my examples SHOULD read "dir D:" NOT dir "dir /D". My bad.
Newbie + Exec() = Unable to Fork
Andy !
I have been trying for weeks to exec another script with the exec function within PHP but exec just won't work at all.
Have you discovered the secret yet ?
I posted the following question but have yet to hear from anyone who knows the answer:
Must exec() be enabled/switched on when compiling PHP as with XML or Sockets ?
Peter M
What version of PHP are you using???? The bugs have been worked out in PHP 4.0.6 . I had the same problems with Windows, but they were solved with the upgrade.
Download the windows self installer and enjoy. http://www.php.net/
Got the whole latest stuff on my comp; still doesn't work. Config is the same as Andy's one. A man here http://aspn.activestate.com/ASPN/Mail/Message/php-Dev/686680 reports that that issue still - exec/system on win - still not fixed in 4.0.6. So, Peter, if you have some special secret, PLEASE share your knowledge with us.
I have been able to exec another PHP script in the following manner:
exec("/usr/bin/php -q ./test2.php '$line1 $line2 $line3 $footer'");
I also have been able to use the system function as follows PHP to fire PGP:
system("/usr/local/bin/pgp -at $clear $keyName -o $crypted >/dev/null 2>&1");
There appear to be some PHP verion/configuration and op system issues with the exec() function and perhaps with system() as well, but that way above my head.
Hope this helps,
Peter
I installed the phpdev bundle on Win2K with PHP 4.06 and I get the unable to fork message too.
Seems like it has not been fixed in this version.
Cheers, Chris.
I think they didn't test it with internal shell commands like dir!
I am banging my head into the same problem. Win98se
php 4.0.6
php.ini directive safe_mode=Off "recommended by fourm in php.net"
php.ini directive safe_mode_exec_dir=none
However, I was able to execute and exec() command when the the executable was located in the $DOCUMENT_ROOT directory (php page directory). This does me no good. Advice any one?
Charlie
Has anyone found a solution to this problem yet - i know these are all old posts, so maybe you can't remember the hell you went through - but i'm going through it now!!
I can't get exec() to work, i have php v.2.1.0 and windows XP, IIS v.5. and all i get is unable to fork.
So? please help me!!
try to install easyphp from www.easyphp.org version 1.5 not 1.6!
Heya, i'm having the same problems,but i don't get any output, no errors, nothing but a blank page, everything works
except the exec and system functions, me win98, apache, php, ssl(no certification), perl, mysql, ms access database... everything works ok, perl does too, i've tryied served parsed .shtml files to execute perl and it does good, i've tryied php(my entire website is in php), i've tryied mySQL(a lot), with ms access databases too, so the only thingy is the exec and system...
plz, help us all