I am wanting to call a php file using exec.
When I call it I want to be able to pass a variable through (an id).
I can call echo exec(\"php /var/www/unity/
this adapted script shows 2 ways of passing parameters to a php script from a php exec command: CALLING SCRIPT
/var/www/ztest/log01.txt 2>&1 &");
echo "ended the calling script";
?>
CALLED SCRIPT
dont forget to verify execution permissions and to create a log01.txt file with write permissions (your apache user will usually be www-data).
RESULT
argv params: Array
(
[0] => /var/www/ztest/helloworld.php
[1] => 12
[2] => target=13
)
got the size right, wilburargv element 1: 12
choose whatever solution you prefer for passing your parameters, all you need to do is access the argv array and retrieve them in the order that they are passed (file name is the 0 element).
tks @hakre