I have a simple perl script that works fine in other servers. I have tried several things to make it work, but it does not seem to react. Let me try to explain how I have it set up and maybe one of you has some insight or an idea on how to make it work.
perl script starts with
#!/usr/bin/perl
I am calling the script from my public_html foler (directly from the web)
inside index.html
I am using the following command inside index.html:
<!--#exec cmd="cgi-bin/hitcounter.pl page_index"-->
I have tried putting "hitcounter.pl" both directly under public_html and under cgi-bin
I have set hitcounter.pl with 755 permissions
The file that I am writting to is inside: public_html/private/
the name of the file is count.txt
I have also set this file to have 755 permissions
My thoughts:
maybe I should not have it in the cgi-bin directory
maybe I have something in my .htaccess that does not allow perl scripts to run?
should I rename from hitcounter.pl to hitcounter.cgi?
I am using relative paths to tell the programs where to find things:
- inside hitcounter.pl, I have the relative path "../private/count.txt" to find the count.txt file (of course when the hitcounter.pl file is inside the cgi-bin directory
- inside the index.html file I have the path "cgi-bin/hitcounter.pl" referenced
The count.txt file was created directly inside cPanel and named as such
At any rate, any help or ideas would be greatly appreciated.
Thanks!
Edit:
I have been searching on the internet, and I am wondering.
Is it possible to include the following line in an html file on this server?
<!--#exec cmd="cgi-bin/hitcounter.pl -summary"-->
Note de cmd instead of cgi
The reason for this is because I am passing in "-summary" as a variable into the command hitcounter.pl
Questions?
- Can I pass in such variables if I use the cgi instead of cmd exec type?
- Does the cmd exec type work?
- If it does work, does it work inside cgi-bin or should I put it inside another directory?
At any rate, thanks for any help you can provide!
Edit:
Hi,
I think I figured out another step in the puzzle. It seems that unless the file the SSI code is in has an extension of ".shtml" the server just does not process it...
So now, when I have
<!--#exec cmd="cgi-bin/hitcounter.pl -summary"-->
inside an .html file and I check the source code from a web browser, the above line still shows
instead if the extension is .shtml, the code above does not show
nevertheless, it does not seem like the code inside hitcounter.pl runs anyhow. It seems like the SSI code is recognized, but either not run or for some reason I might have some typo somewhere...
Any further ideas?
Thanks!
Edit:
One more input after searching the web for answers -- maybe the system administrator can answer this one...
is it possible to do SSI of the type <!--#exec cmd= ??
if so, what are the restrictions or conditions, if any.
Do I need to set something specific or special in the .htaccess file, (e.g. <limit > allow,deny -- or something of the sort?)
Thanks!
perl script starts with
#!/usr/bin/perl
I am calling the script from my public_html foler (directly from the web)
inside index.html
I am using the following command inside index.html:
<!--#exec cmd="cgi-bin/hitcounter.pl page_index"-->
I have tried putting "hitcounter.pl" both directly under public_html and under cgi-bin
I have set hitcounter.pl with 755 permissions
The file that I am writting to is inside: public_html/private/
the name of the file is count.txt
I have also set this file to have 755 permissions
My thoughts:
maybe I should not have it in the cgi-bin directory
maybe I have something in my .htaccess that does not allow perl scripts to run?
should I rename from hitcounter.pl to hitcounter.cgi?
I am using relative paths to tell the programs where to find things:
- inside hitcounter.pl, I have the relative path "../private/count.txt" to find the count.txt file (of course when the hitcounter.pl file is inside the cgi-bin directory
- inside the index.html file I have the path "cgi-bin/hitcounter.pl" referenced
The count.txt file was created directly inside cPanel and named as such
At any rate, any help or ideas would be greatly appreciated.
Thanks!
Edit:
I have been searching on the internet, and I am wondering.
Is it possible to include the following line in an html file on this server?
<!--#exec cmd="cgi-bin/hitcounter.pl -summary"-->
Note de cmd instead of cgi
The reason for this is because I am passing in "-summary" as a variable into the command hitcounter.pl
Questions?
- Can I pass in such variables if I use the cgi instead of cmd exec type?
- Does the cmd exec type work?
- If it does work, does it work inside cgi-bin or should I put it inside another directory?
At any rate, thanks for any help you can provide!
Edit:
Hi,
I think I figured out another step in the puzzle. It seems that unless the file the SSI code is in has an extension of ".shtml" the server just does not process it...
So now, when I have
<!--#exec cmd="cgi-bin/hitcounter.pl -summary"-->
inside an .html file and I check the source code from a web browser, the above line still shows
instead if the extension is .shtml, the code above does not show
nevertheless, it does not seem like the code inside hitcounter.pl runs anyhow. It seems like the SSI code is recognized, but either not run or for some reason I might have some typo somewhere...
Any further ideas?
Thanks!
Edit:
One more input after searching the web for answers -- maybe the system administrator can answer this one...
is it possible to do SSI of the type <!--#exec cmd= ??
if so, what are the restrictions or conditions, if any.
Do I need to set something specific or special in the .htaccess file, (e.g. <limit > allow,deny -- or something of the sort?)
Thanks!
Last edited by a moderator: