Apache, PHP, Python, Numarray, and Matplotlib (sound fun?)

[Fri Jul 16 16:30:30 2004] [error]

  > [Fri Jul 16 16:30:30 2004] [error] from backend_gtkagg import
  > error_msg, draw_if_interactive, show, new_figure_manager

Here is your problem - a web app server should not be using gtkagg
(this is a GUI interface). You should be using Agg (which doesn't
require X11, a DISPLAY var etc).

You can either set backend : Agg to be your default backend in
matplotlib rrc - http://matplotlib.sf.net/.matplotlibrc or do the
following at the top of your script (before importing

import matplotlib
from matplotlib.matlab import .... whatever you usually do

Should work...