Re: Unable to execute c++ .exe file from php
| From: | Ladan Pickering | Date: | Fri, 08 Nov 2002 20:10:58 +0000 |
| Subject: | Re: Unable to execute c++ .exe file from php | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-123469@lists.php.net to get a copy of this message | ||
I have tried escaping with backslashes and also tried
forward slashes with no luck. I believe my path
specification is correct because I can look at
different directories.
$cmd = "dir c:\abc\efg";
system ($cmd, $errCode);
Correctly display the content of "efg", and the
errCode is 0;
I think the key to my problem is the return_var
(errCode) of 128. (That is what I get in errCode when
I try to execute hello.exe)
Do you know where the return_var(s) for php
(exec, system, ...) are defined?
Is there something in php.ini that have to be set up
inorder to be able to execute a file on the server?
I have looked at php.net but had no luck.
Thanks for your suggestions.
"Marek Kilimajer" <kilimajer@webglobe.sk> wrote in
message news:3DCBCF6B.9050000@webglobe.sk...
> escape your backslashes:
>
> $cmd = "c:\\abc\\hello.exe";
>
>
>
> Ladan Pickering wrote:
>
> >I am unable to execute my c++ program from within
PHP when it runs as a
> >cgi in Apache.
> >I am able to run:
> >
> >$cmd="dir c:\abc"
> >system ($cmd, $errCode);
> >
> >and see the content of the directory, but I don't
seem to
> >be able to run a simple hello.exe (c++) file.
> >
> >$cmd = "c:\abc\hello.exe";
> >system ($cmd, $errCode);
> >
> >The errCode always comes back with 128. What does
128 mean?
> >
> >Here is some info on my setup.
> >OS: Windows XP
> >Server: Apache 2.0.43 (win32)
> >PHP 4.2.3
> >I am running PHP as a CGI
> >
> >I am able to execute my c++ program (hello.exe)
from this .php file
> >just fine if I use the PHP cli.
> >
> >I appreciate any help.
> >
> >
> >
> >
>
__________________________________________________
Do you Yahoo!?
U2 on LAUNCH - Exclusive greatest hits videos
http://launch.yahoo.com/u2