Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to call an executable from PHP 4

Status
Not open for further replies.

happyIndian100

Programmer
Jul 20, 2003
66
US

I have an executable. i need to call from php page.

then environment we are using is php4,linux,apache.


any suggesstions are appretiated.

thanks
-mike
 
Look at the exec() function.
But temember this will execute at the server not on the client PC.
 
currently i am using exec like this:

exec("./util.exe test1.txt test1");

util.exe supposed to generate 2 files.

i am not getting any error message but the files are not generated.

when i type the command "./util.exe test1.txt test1" at shell prompt manually it generated the files.

any ideas...
 
try a >> /tmp/op.txt in the exec and then have a look at the file /tmp/op.txt, it might give us some clue.
 
now were pusing my Unix here, I think we will have to redirect the error stream which I think is by 0>fred.txt - or something very close to it.
One basic thing does ./ point to the code when running under the web server user ? try putting the full path to the exe.
In fact try that before the redirect.
 

thx ingresman, when i put the full path it works now.

Thanks a lot
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top