httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ben Yau" <b...@cardcommerce.com>
Subject RE: [users@httpd] Strange problem with scripts
Date Fri, 23 Jan 2004 19:35:47 GMT

>
>
>
> this is just too strange. I have tried every method I can find
> for sending<br>email from perl/cgi scripts. I have found that
> when I use Net::SMTP<br>everything works fine from the console.
> However, when I point my browser to<br>the script, it hangs
> around for a while doing nothing before outputting a<br>blank
> page. Strange thing is, i have heaps of other scripts (that do
> not<br>involve sending email) that work fine.  Any help greatly
> appreciated.<br><br>(yes i do have root access to the
>
> I'm sure you already done this but I'll mention it just incase.
>
> Check log files :error_log, access_log, on UNixish servers also
> check /var/log/messages.
>

In this I would also check the sendmail log file.  Also, are you doing error
checking in your perl script ?  If nothing is being output to the page, the
script could be dying on an error.  Do some error checking and capturing so
the script can go on even if a procedure fails so at least you can get some
diagnostics.

e.g. a snippet from a cgi i wrote that allows you to copy files via cgi


# copy file and get status

$status=copy("$file","$destdir/$newname");

# check status of copy .. if stauts is 0, we got an error and output error
string

if ($status == 0) {
    print qq*<font color="red">Could not copy $file: "$!"</font><br>\n*;
} else {

# status is not 0, so let's output success and delete old file
    print qq*<font color="blue">Copy Successful!</font><br>\n*;

# attempt to delete old file
    $ulstatus = unlink $file;

# check status of delete
    if ($ulstatus == 0) {
         print qq*<font color="red">Could not delete $file:
"$!"</font><br>\n*;
    } else {
         print qq*<font color="blue">Delete Successful!</font><br>\n*;
    }
}






---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message