I need to execute a php file with parameters through shell.
here is how I would run the php file:
php -q htdocs/file.php
If you are using it from a PHP file then you can use popen() and do something like this:
$part = $show_name; //or whatever you want with spaces
$handle = popen("php -q nah.php -p=". escapeshellarg($part) . " 2>&1", "r");
This uses the escapeshellarg() function in order to wrap the $part variable in quotes (and escape any quotes inside it), so that it can be used as a shell argument safely.