views:

43

answers:

1

Although I can run test.cgi from the same location but app.cgi gives "Internal Server Error". I checked the permissions, chmoded 755 to everything.

The app is located in domains root so the url will be domain.com/app.cgi

This is the htaccess:

AddHandler cgi-script .cgi
Options +ExecCGI

IndexIgnore *
DirectoryIndex app.cgi


RewriteEngine on

RewriteRule ^$ app.cgi [L]
RewriteRule ^/$ app.cgi [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ app.cgi/$1

I'd really appreciate any help. Many Thanks!

+3  A: 

Is there an error in your perl script? If your script doesn't compile you will get an Internal Server Error even if everything else is configured correctly.

Does your script print the headers (at a minimum, something like, Content-type: text/html\n\n) before any other output?

Your server's error logs should contain some information either from the perl interpreter or from the web server about why a CGI script failed to run.

Keep the stackoverflow Perl-CGI troubleshooting guide handy:

http://stackoverflow.com/questions/2165022/how-can-i-troubleshoot-my-perl-cgi-script

mobrule
Thanks, I checked the server log and found this: "String found where operator expected at app.cgi line 4, near "use lib './lib'"" and more errors. I wonder why the same app works on a different host?
Nimbuz