如何通过php_shell使用argv调用php代码
我需要通过PHP_shell调用带有参数的PHP文件。 我所做的:如何通过php_shell使用argv调用php代码,php,arguments,php-7,Php,Arguments,Php 7,我需要通过PHP_shell调用带有参数的PHP文件。 我所做的: $output = shell_exec("php -n -s $script_path/test.php $one $two, $three"); if($output !=null) { echo "your file called"; }else{ echo "Your file not called"; } 但是它没有运行test.php文件 建议我在这个配置中遗漏了什么,我正在使用PHP
$output = shell_exec("php -n -s $script_path/test.php $one $two, $three");
if($output !=null)
{
echo "your file called";
}else{
echo "Your file not called";
}
但是它没有运行test.php
文件
建议我在这个配置中遗漏了什么,我正在使用PHP strom。是否有任何环境设置?您是否可以尝试使用
shell\u exec(“php cli…
?@ImAtWar如果我添加php cli,它会转到其他部分,如“未调用您的文件”。文件是否存在?您使用的是什么路径?@ImAtWar是的,文件在那里,我从post值中获取文件路径($script path)有问题吗?您可以尝试输入php安装的完整路径,在shell中使用哪个php
找到它。例如/usr/bin/php
。