问题
How can I run a a Perl script in every page of the server?
I put the code at /var/www/cgi-bin
, now I need the correct the code to run it. Where should I place it.
I have added this code to the httpd.conf:
- Action add-footer /cgi-bin/script.cgi
- AddHandler add-footer .htm .htm
and on the site I have added the code script.
If the page is .html the code runs but is the page is PHP the code does not run.
I have tried this but is does not work, in works on HTML files but not in 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>
回答1:
The way I was trying does not work with Dynamic Content it only work with Static Content.
来源:https://stackoverflow.com/questions/23940239/run-a-perl-script-in-php-plesk-11