简体   繁体   中英

CGI script showing as plain text

I have done the following checks:

  • shebang line
  • file extension .cgi
  • script is executable
  • restarted apache

I've done the following in my project.conf file on Vagrant under /sites-enabled:

<Directory /var/www/perl_project/cgi-bin>
      Options ExecCGI
      SetHandler cgi-script
</Directory>

I'm pointing to http://project.local/cgi-bin/routes.cgi?page=reports in my links, but they bring up the text of the script and don't run them...

The script isn't displaying any HTML, it is a kind of router where I get query string and based on that load a template toolkit file

could someone please help?

I placed my cgi scripts under /usr/lib/cgi-bin

After installing the mod_cgi module I noticed a /cgi-bin directory was created under /vagrant , but that didn't work for some reason so I hunted down the former cgi-bin directory.

Hope this helps someone

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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