Take the 2-minute tour ×

just wanted to know how to call php script from running C code on Linux and pass a couple of parameters.


share|improve this question
add comment

1 Answer

up vote 1 down vote accepted
system("/usr/bin/php /path/to/program.php param1 param2");
share|improve this answer
You should rather advice the use of execlp() or something like it, for security reasons. –  Scytale Aug 12 '10 at 17:50
Ugh, system(). Stay away! –  tc. Aug 12 '10 at 18:05
This is a perfectly acceptable answer to the question that was asked. There was no mention of any mistrust of the script or data passed to it. –  nategoose Aug 12 '10 at 19:24
add comment

Your Answer


