Nobbie wrote:And what gives it in error log of Apache?
this is Apache's error log after I moved the cgi-bin to htdocs. Although I used to think that the server CAN serve something thats not even in the htdocs but anyway, I would just be happy to run PERL to say the least.
- Code: Select all
[Wed Nov 25 07:59:02 2009] [error] [client ::1] (2)No such file or directory: exec of '/Applications/xampp/xamppfiles/cgi-bin/1.pl' failed
[Wed Nov 25 07:59:02 2009] [error] [client ::1] Premature end of script headers: 1.pl
[Wed Nov 25 07:59:02 2009] [error] [client ::1] File does not exist: /Applications/xampp/xamppfiles/htdocs/favicon.ico, referer: http://localhost/cgi-bin/1.pl
Nobbie wrote:Seems to be honestly true - you should apply "Options ExecCGI" to your htdocs (DocumentRoot) folder in httpd.conf and restart Apache
I have this:
- Code: Select all
ScriptAlias /cgi-bin/ "/Applications/xampp/xamppfiles/htdocs/cgi-bin/"
</IfModule>
#
# "/Applications/xampp/xamppfiles/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
<Directory "/Applications/xampp/xamppfiles/htdocs/cgi-bin">
#AllowOverride None
#Options None
AllowOverride All
Options ExecCGI
Order allow,deny
Allow from all
AddHandler cgi-script .pl
</Directory>
destudent wrote:I am running XAMPP on Mac OSX. My source code is this:
- Code: Select all
#!usr/local/bin/perl
print "Content-type: text/plain; charset=iso-8859-1\n\n";
print "hello";
Nobbie wrote:Is there a valid Perl Interpreter installed at /usr/local/bin/perl? If not, your Shebang line is wrong, it must point to a perl binary.
A which perl command told me that perl is installed under /usr/bin/perl. But I do not know if XAMPP can access that. ......
Update: It CANNOT access that. I used a PERL interpreter that came with XAMPP and it worked. lol
destudent wrote:Perhaps I am not doing something right. I also have a question that how can these files be run when they are not under htdocs?
Define a "ScriptAlias" Directive for the desired folder (you will find an example in httpd.conf for /cgi-bin, which is actually not under htdocs).[/quote]
----Thanks a lot. Your reply made me drifted me in the right direction. THanks. --AJ