I'm just not cut out for web programming, I guess :)

John Salerno johnjsal at NOSPAMgmail.com
Wed May 17 22:45:09 EDT 2006


John Salerno wrote:
> Paul McNett wrote:
> 
>> Are you sure the python that the web server runs has the cryptogen 
>> module available? 
> 
> Yes, this module and the cryptogen module (and the quotes.txt file) are 
> all in the same directory on the server.
> 
>> Have you set the execute bit on your script? 
> 
> Yes, I have them both set to 755.
> 
>> What's 
>> the output in your web server error log?
> 
> Well, I can't seem to find any error logs. In my logs folder, there are 
> files called 'access.log' and 'ftp.log', but nothing that looks like an 
> error log.

Hmmm, looks like they don't do error logging:



  Creating own error logs for debugging php scripts.

Since we dont provide access to Apache error logs on shared hosting 
packages for
technical reasons, you can create your own error logs for debugging PHP 
Scripts.

Please insert the following code in your PHP script (or create separate 
file and
and add the code in it. Include the file using "include()")


    error_reporting(0);
    $old_error_handler = set_error_handler("userErrorHandler");

    function userErrorHandler ($errno, $errmsg, $filename, $linenum, 
$vars)
    {
      $time=date("d M Y H:i:s");
      // Get the error type from the error number
      $errortype = array (1    => "Error",
                          2    => "Warning",
                          4    => "Parsing Error",
                          8    => "Notice",
                          16   => "Core Error",
                          32   => "Core Warning",
                          64   => "Compile Error",
                          128  => "Compile Warning",
                          256  => "User Error",
                          512  => "User Warning",
                          1024 => "User Notice");
       $errlevel=$errortype[$errno];

       //Write error to log file (CSV format)
       $errfile=fopen("errors.csv","a");
       fputs($errfile,"\"$time\",\"$filename:
       $linenum\",\"($errlevel) $errmsg\"\r\n");
       fclose($errfile);

       if($errno!=2 && $errno!=8) {
          //Terminate script if fatal errror
          die("A fatal error has occured. Script execution has been 
aborted");
       }
    }




More information about the Python-list mailing list