Executing Program from PHP

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
User avatar
Krishma
Forum Newbie
Posts: 6
Joined: Tue Feb 07, 2006 10:30 am
Location: Montreal

Executing Program from PHP

Post by Krishma »

Hi:

I am trying to execute a C program by

$last_line = system('/doc/tmp/filter', $retval);

Where Filter is Output file on Linux located in directory /doc/tmp. My php file is in my web directory. How can I call execuateble file Filter to run it from my php file.

Thanks,
Krishma
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

that should generally be fine, however if php doesn't have the rights to run it, which is likely, then you're stuck.
User avatar
Krishma
Forum Newbie
Posts: 6
Joined: Tue Feb 07, 2006 10:30 am
Location: Montreal

Hi

Post by Krishma »

I can run ls , cat, ps and all linux commands but not PHP. I don't think this is the issue
Post Reply