【发布时间】:2015-05-08 20:40:48
【问题描述】:
我有一个执行 php 脚本的 perl 脚本:
my $phpOutput = `/usr/bin/php /bart/bart.php`;
这工作得很好。现在我想在 url 中添加一些变量。
my $phpOutput = `/usr/bin/php /bart/bart.php?data=1`;
这失败了。
Could not open input file: /bart/bart.php?data=1
任何想法为什么?
【问题讨论】:
-
在这种情况下,我不认为它真的是一个 URL。
-
看起来它只是在shell中执行它。不能使用php.net/manual/en/reserved.variables.argv.php?
-
去掉问号再添加
/试试? -
@anantkumarsingh 如何解决问题?
-
This answer 有一种有趣的方式来处理这个问题。但看起来您需要以一种或另一种方式更改 PHP 脚本才能处理以这种方式调用它。