简体   繁体   English

从PHP执行Perl脚本

[英]Execute perl script from PHP

I trying to execute perl script from php with the following code: 我尝试使用以下代码从php执行perl脚本:

$command = "/usr/bin/perl /var/www/html/perl/test.pl 1 2";
exec($command, $output);
var_dump($output);

But never works it. 但是永远都行不通。

I tried with system, passthru, exec_shell but script doesn't works. 我尝试使用system,passthru,exec_shell,但是脚本不起作用。

Can you help me? 你能帮助我吗?

Are you using a older version of PHP? 您是否在使用旧版本的PHP? If so, you might be runing in safe mode. 如果是这样,您可能正在安全模式下运行。 Also you could check your folder privileges 您也可以检查文件夹权限

You can read more about safe mode here Link 你可以阅读更多有关安全模式在这里链接

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM