I am trying to execute a php script from within another php script. I cant seem to get it to pass the parameters properly. What am I doing wrong?
First script called
<?php
$item = "hello";
$item2 = "world";
exec("php scriptToBeExecuted.php arg1=".$item." arg2=".$item2." &");
?>
Script to be executed
<?php
var_dump($argc);
if (isset($argv))
{
parse_str(implode('&', array_slice($argv, 1)), $_GET);
$item= $_GET['arg1'];
$item2= $_GET['arg2'];;
}
else
{
echo "not set";
}
?>
I do not recieve any output in a browser when I try to execute this. Which isn't the main issue because I am using this to make database calls but like I said, after hours of fussing with this, it will not execute properly or at all