scripts.mit.edu

MIT SIPB Script Services for Athena

How do I debug my scripts?

scripts.mit.edu keeps per-user error logs on each server to assist with debugging recalcitrant CGI scripts. Here are some ways you can convince your scripts to give you more information:

  • You can view error logs in real time using the ‘logview’ command on a Scripts server. Note that you need to be SSH’ed into the server that is serving your website, and not necessarily scripts.mit.edu server. If your website is on the default Fedora 20 pool (which it will be if you have not changed the pool using https://pony.scripts.mit.edu), you can determine what server you are being load-balanced to by checking the bottom of https://scripts.mit.edu and looking for “You are currently connected to XXX.mit.edu” server. If you have moved your website to the Fedora 30 pool, you should instead check the bottom of http://scripts-f30.mit.edu.
  • If you have a PHP script that is failing with no error output, you likely have error reporting turned off. Open or create a php.ini file in the same directory as the script, and in it ensure that “display_errors = on” and “error_reporting = E_ALL ^ E_NOTICE”. This will cause errors to be displayed on the web page.
  • If you have some script that you know is writing information to stderr that you want to see, you can often run it directly from the command line via SSH to scripts and see if it outputs anything interesting. Nota bene: the configuration of the command line may be subtly different than that invoked from the web, for example, php from the command line will not load a php.ini file in the directory; you’ll need to manually add it with -c
  • If your FastCGI script is not working and you’re getting error messages like:
    [Fri Oct 29 20:31:04 2010] [notice] mod_fcgid: process
      /afs/athena.mit.edu/contrib/scripts/web_scripts/index.fcgi(15116)
      exit(communication error), terminated by calling exit(), return code: 121
    this probably means your index.fcgi is lacking the executable bit. You can set it using chmod a+x index.fcgi.
Previous:
Next:
© 2004-2020, the SIPB scripts.mit.edu project.
These pages may be reused under either the GFDL 1.2 or CC-BY-SA 3.0.
Questions? Contact scripts@mit.edu.

You are currently connected to cats-whiskers.mit.edu.