Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/perl/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在PHP-plesk11中运行一个Perl脚本_Perl_Plesk - Fatal编程技术网

在PHP-plesk11中运行一个Perl脚本

在PHP-plesk11中运行一个Perl脚本,perl,plesk,Perl,Plesk,如何在服务器的每个页面上运行Perl脚本 我把代码放在/var/www/cgi-bin,现在我需要正确的代码来运行它。我应该把它放在哪里 我已将此代码添加到httpd.conf中: 操作添加页脚/cgi-bin/script.cgi AddHandler add footer.htm.htm 我在网站上添加了代码脚本 如果页面为.html,则代码运行,但如果页面为PHP,则代码不运行 我已经试过了,但它不起作用,在HTML文件上工作,但在PHP中不起作用 <Directory / &g

如何在服务器的每个页面上运行Perl脚本

我把代码放在
/var/www/cgi-bin
,现在我需要正确的代码来运行它。我应该把它放在哪里

我已将此代码添加到httpd.conf中:

  • 操作添加页脚/cgi-bin/script.cgi
  • AddHandler add footer.htm.htm
我在网站上添加了代码脚本

如果页面为.html,则代码运行,但如果页面为PHP,则代码不运行

我已经试过了,但它不起作用,在HTML文件上工作,但在PHP中不起作用

<Directory / >
  Options +ExecCGI
  AddHandler cgi-script .cgi .pl
  AddHandler application/x-httpd-php5 .php
  AddHandler application/x-httpd-php .html .htm
  AddHandler php-cgi .php 
  AddHandler cgi-script cgi pl
  AddHandler cgi-script .html
  AddHandler cgi-script .php

  Action add-footer /cgi-bin/script.cgi 
  AddHandler add-footer .html .htm .php php
</Directory>

选项+执行CGI
AddHandler cgi script.cgi.pl
AddHandler应用程序/x-httpd-php5.php
AddHandler应用程序/x-httpd-php.html.htm
php.php
AddHandler cgi脚本cgi pl
AddHandler cgi script.html
AddHandler cgi script.php
操作添加页脚/cgi-bin/script.cgi
AddHandler add footer.html.htm.php

我尝试的方法不适用于动态内容,它只适用于静态内容。

你是什么意思?我不明白你的意思question@Paulchenkiller我已经更新了这个问题。好的,如果我理解你的意思是正确的,你想在每个交付的页面上添加一个
Php
-页脚吗?我只是想知道,为什么我认为你应该重新考虑你需要什么。例如,您可以创建一个模板文件,并用Perl填充该模板文件。例如,我设法使它与HTML一起工作,现在我需要使它在PHP文件上工作??