|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
You don't need a fax machine to get faxes. Get a fax-to-email fax number from CallWave. Try it free.
|
|
#1
|
|||
|
|||
|
Can't use system() or exec() in Windows
Hi,
I have PHP 4.2.3 and I can't execute anything! Windows XP Pro w/ IIS 5.1, using PHP in the command-line <?PHP $temp = `"cmd"`; echo $temp; echo "<hr>"; exec("cmd /c echo 1"); ?> Warning: Unable to execute '"cmd"' in c:inetpubwwwroottest.php on line 4 -------------------------------------------------------------------------------- Warning: Unable to fork [cmd /c echo 1] in c:inetpubwwwroottest.php on line 7 |
|
#2
|
|||
|
|||
|
RE: Can't use system() or exec() in Windows
It may be that cmd isn't in the path when using those functions..try the absolute path to cmd...
$temp = `"c:windowscmd.exe"`; |
|
#3
|
|||
|
|||
|
RE: Can't use system() or exec() in Windows
C:WINDOWSsystem32cmd.exe Warning: Unable to execute '"C:WINDOWSsystem32cmd.exe"' in c:inetpubwwwroottest.php on line 5 Warning: Unable to execute '"C:WINDOWScmd.exe"' in c:inetpubwwwroottest.php on line 7 -------------------------------------------------------------------------------- Warning: Unable to fork [C:WINDOWSsystem32cmd.exe /C] in c:inetpubwwwroottest.php on line 10 Warning: Unable to fork [notepad.exe] in c:inetpubwwwroottest.php on line 11 |
|
#4
|
|||
|
|||
|
RE: Can't use system() or exec() in Windows
I'm using apache 2 and it seems to work now
|
|
#5
|
|||
|
|||
|
RE: Can't use system() or exec() in Windows
try:
exec("start c:\temp\yourprogram.exe"); Make sure the yourprogram.exe file in the TEMP folder has Read&Execute permissions for the IUSR_servername anonymous account. In my case, exec("start c:\temp\netsmtp.pl"); worked, where this is a Perl script. Note that the Perl script interpreter (perl.exe) also needs to have Read&Execute permissions for the IUSR_servername anonymous account. --Pete |
|
#6
|
|||
|
|||
|
RE: Can't use system() or exec() in Windows
try:
exec("start c:\temp\yourprogram.exe"); Make sure the yourprogram.exe file in the TEMP folder has Read&Execute permissions for the IUSR_servername anonymous account. In my case, exec("start c:\temp\netsmtp.pl"); worked, where this is a Perl script. Note that the Perl script interpreter (perl.exe) also needs to have Read&Execute permissions for the IUSR_servername anonymous account. --Pete |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Server Administration > Can't use system() or exec() in Windows |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|
|