yes and they seems to be fine
>Is it using sendmail and is the path right?
yes and the path is correct,
$mail_cmd = '/usr/lib/sendmail';
>Are you sure you have the path to perl correct?
Yes, #!/usr/local/bin/perl
>Did you upload it in the correct format? (ie: ascii?)
Yup, I dunno whats wrong.
These are the init things that I am supposed to change in the instructions.
$content_type = "Content-type: text/html\n\n";
$base_path = '/u/web/myaccount';
$mail_cmd = '/usr/lib/sendmail';
@Referers = ('www.myurl.com','myurl.com');
I think i have them correct but I am not 100% sure about the $base_path var.
Here is what my host says on implementing custom scripts:
Perl Scripts
Upload to your cgi-local directory to ensure proper file permission settings
Upload in ASCII transfer mode (and NOT BINARY mode)
The first line of each script must read: #!/usr/local/bin/perl
Use the Perl script checker in your Control Panel to check syntax.
Always remember to include print "Content-type: text/html\n\n"; or alternatively using the Perl module CGI.pm (If you do not, your scripts will not run and you will get an Internal Server Error message).
They also say:
If a script calls another file within your account, but the script does NOT require a URL, you need to use the system path. Instead of using the absolute path to your home directory ("/www26/web/someid"), you should instead use the DOCUMENT_ROOT environment variable ($ENV{DOCUMENT_ROOT} in Perl) to determine the path of your files or programs within a script.
Change this: /www23/web/yourid/data/fact.html
To this: $ENV{DOCUMENT_ROOT}/data/fact.html
Any ideas?
Is it actually running and just not behaving correctly, or is it failing to run?
if it's failing to run, run it from the command line, or run it like "perl -c file.cgi" and see what it says. (and then act on that information. The error messages are more important than you think. They're not just there for the programmers' satisfaction.) You can also check the error logs of your server.
There are about a million things that would keep a script from running. One common tricky one is that your file is in wondows format and you have it on a linux machine, so the firs line that looks like "#!/usr/bin/perl" actually has CR/LF line ending problems that keep apache from finding perl correctly. re-type that line. Also, is that the right path to perl? Are all of the necessary modules installed? are the permissions set? is ExecCGI turned on in that directory? for that file extension?
If it is running and just not working right, is it because it's spitting out an error before the headers? what does your error log say?
Output of "perl -c -w cgi-local/af.pl":
/[^\w-\./\\]+/: false [] range "\w-" in regexp at /u/web/mysite/cgi-local/af.pl line 186.
/[^\w-\./\\]+/: false [] range "\w-" in regexp at /u/web/mysite/cgi-local/af.pl line 198.
Name "Mail::Sendmail::error" used only once: possible typo at /u/web/mysite/cgi-local/af.pl line 301.
/u/web/mysite/cgi-local/af.pl syntax OK
If so do this
<?
phpinfo();
?>
Save as something.php then open that in the browser and it should give you the base path in there. If you still cant find it remove the ; from it and it will out put an pharse error in base path/filename.php on line 2.
<added> I dont know perl well enough to make heads or tails of those errors, sorry. Possibly someone more versed in Perl will stick there head in and give you a hand.
[edited by: Knowles at 4:23 pm (utc) on July 16, 2002]
Now run it from the command line and see if it dumps out a valid header before anything else. It should start with a few lines like:
Content-type: text/html
and then a blank line.
Also, any reason why you won't look in your webserver error logs? The error logs are everything. The programs will actually tell you what's wrong with themselves.