[英]How can I include the output of a Perl script into a PHP page?
We've been asked to support some rather old Perl forms on a new site, as we're using a PHP based CMS we need to include the Perl scripts into our new CMS. 我们被要求在新网站上支持一些相当旧的Perl表单,因为我们正在使用基于PHP的CMS,我们需要将Perl脚本包含到我们的新CMS中。
I've tried a bit of shell_exec but that's disabled. 我已经尝试了一些shell_exec但是已经禁用了。 Has anyone got any ideas?
有没有人有任何想法?
There is a Perl extension available for PHP. 有一个可用于PHP的Perl扩展。
An article from the Zend developer zone details it here . 从Zend开发人员专区的文章详细介绍了它在这里 。
The extension allows you to: 该扩展程序允许您:
You can obtain it from CVS using this command: 您可以使用以下命令从CVS获取它:
$ cvs -d :pserver:cvs.php.net:/repository co pecl/perl
An example of running a Perl script is listed here: 此处列出了运行Perl脚本的示例:
print "Hello from Perl! "
<?php
print "Hello from PHP! ";
$perl = new Perl();
$perl->require("test1.pl");
print "Bye! ";
?>
If you Perl script is creating the page with the forms that you client is supposed to be able to change, then you are out of luck. 如果您的Perl脚本正在创建包含客户端应该能够更改的表单的页面,那么您就不走运了。 You might be able to come up with some PHP page that contains the output of the Perl script, but you'll never be able to feed any changes on that page back into the Perl script.
您可能会想出一些包含Perl脚本输出的PHP页面,但您永远无法将该页面上的任何更改反馈到Perl脚本中。
what about a php apache function virtual() ? 那个php apache函数virtual()怎么样? http://php.net/manual/en/function.virtual.php I thing that combination of this and mod_rewrite is viable
http://php.net/manual/en/function.virtual.php我认为这个和mod_rewrite的组合是可行的
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.