i have uploaded the script in ASCII format and when i execute the script on command prompt, it works well and gives [TextCounter Fatal Error: Could Not Increment Counter].
When i run it in the browser, it is the same error.
i think this is bcoz the counter cannot write to the specified file in the folder but the folder has 777 permissions.
when tried replacing the $ENV{'DOCUMENT_URI'} with $ENV{'DOCUMENT_URI'}¦¦$ENV {'SCRIPT_NAME'} the script returns a number which is incremented every time it is executed.
But this does not happen when the file reference is added to the html page.
is there a way out of it!
thanks
/home/user/website/counterdir
and counterdir has 777 perms, you might look at the permissions for home, user, and website -- try setting them liberally at first -- if that works, drop them back to the minimum permissions that retain functionality.
As far as the envirnonment variables go, realize that you're dealing with a different environment when you run the script from the command line from when you run it in the web server -- the web server sets a bunch of the http related environment variables, and they aren't going to be there from the command line. For debugging, if you have the CGI perl module installed (most boxes do) you can add this to the top of the script:
use CGI::Carp "fatalsToBrowser";
If it works, it'll show you a much more specific error in the browser. Be sure to comment out the line (with a #) when you're done, of course.
The script is now working on the command prompt.
When executed with the -W option, shows no errors at all.
The counter increments itself when run on command prompt but when i add the reference of the script to the webpage and open the webpage, the counter does not increment itself.
Is there still any error in the scriptwhich is not so obvious
i tried the CGI::Carp"fatalsToBrowser" but since the same subroutine already exists in the script had to comment it.