Re: [Matplotlib-users] Crash on import with CGI wrapped by PHP--unhappy with .matplotlib directory?

2008-08-01 Thread Michael Droettboom
This is getting a bit outside of my knowledge area, but it does look like the environment variables are not being set up correctly when the Python process is run. This is probably a more general apache/mod_php sort of question, but it would be great to post the answer here so we can add a solu

Re: [Matplotlib-users] Crash on import with CGI wrapped by PHP--unhappy with .matplotlib directory?

2008-08-01 Thread "Jonathan Hayward, http://JonathansCorner.com"
It looks like an apache that thinks it's root: os.system("whoami") print "" print os.geteuid() print "" print os.getuid() print "" print os.path.expanduser("~") print "" print os.getenv("HOME") print "" print os.getenv("USERPROFILE") print "" print os.getenv("USER") print "" print os.getenv("TMP")

Re: [Matplotlib-users] Crash on import with CGI wrapped by PHP--unhappy with .matplotlib directory?

2008-08-01 Thread Michael Droettboom
Below is the code in mpl that actually does the lookup. To get to the bottom of this, I would try to figure out in your Apache/PHP environment what a) what os.path.expanduser("~") gives b) what the values of the environment variables "HOME", "USERPROFILE", "USER", and "TMP" are. I su

Re: [Matplotlib-users] Crash on import with CGI wrapped by PHP--unhappy with .matplotlib directory?

2008-08-01 Thread "Jonathan Hayward, http://JonathansCorner.com"
User apache exists with home directory /var/www, which exists. On Fri, Aug 1, 2008 at 11:59 AM, Michael Droettboom <[EMAIL PROTECTED]> wrote: > It's supposed to default to the current user's home directory. Perhaps > "apache" doesn't have a home directory? > > Cheers, > Mike > > "Jonathan Haywar

Re: [Matplotlib-users] Crash on import with CGI wrapped by PHP--unhappy with .matplotlib directory?

2008-08-01 Thread "Jonathan Hayward, http://JonathansCorner.com"
I found a reason for the behavior: The script was running as user apache, but trying to open /root/.matplotlib, and /root was mode 0700. It stopped crashing on import after I made /root mode 0711. This is somewhat surprising behavior to me; shouldn't it be defaulting to something besides expected

Re: [Matplotlib-users] Crash on import with CGI wrapped by PHP--unhappy with .matplotlib directory?

2008-08-01 Thread Michael Droettboom
It's supposed to default to the current user's home directory. Perhaps "apache" doesn't have a home directory? Cheers, Mike "Jonathan Hayward, http://JonathansCorner.com"; wrote: > I found a reason for the behavior: > > The script was running as user apache, but trying to open > /root/.matplot

Re: [Matplotlib-users] Crash on import with CGI wrapped by PHP--unhappy with .matplotlib directory?

2008-08-01 Thread "Jonathan Hayward, http://JonathansCorner.com"
I found a reason for the behavior: The script was running as user apache, but trying to open /root/.matplotlib, and /root was mode 0700. It stopped crashing on import after I made /root mode 0711. This is somewhat surprising behavior to me; shouldn't it be defaulting to something besides expected

Re: [Matplotlib-users] Crash on import with CGI wrapped by PHP--unhappy with .matplotlib directory?

2008-08-01 Thread "Jonathan Hayward, http://JonathansCorner.com"
Tried that and reran it; I'm getting substantially the same stacktrace: File "/home/jhayward/bintmp/test.py", line 5, in import matplotlib; File "/usr/lib64/python2.5/site-packages/matplotlib/__init__.py", line 639, in rcParams = rc_params() File "/usr/lib64/python2.5/site-packages

Re: [Matplotlib-users] Crash on import with CGI wrapped by PHP--unhappy with .matplotlib directory?

2008-08-01 Thread Michael Droettboom
Just throwing out a suggestion here: You could try putting a matplotlibrc file in the same directory as your Python script -- it will use that instead of the one in ~/.matplotlib. Cheers, Mike "Jonathan Hayward, http://JonathansCorner.com"; wrote: > I have a PHP script which authenticates a use

[Matplotlib-users] Crash on import with CGI wrapped by PHP--unhappy with .matplotlib directory?

2008-08-01 Thread "Jonathan Hayward, http://JonathansCorner.com"
I have a PHP script which authenticates a user and I am trying to get the PHP script to wrap a Python script using matplotlib. As it is, the script mostly works when invoked from the command line or as its own CGI script. When I call it from a PHP script, it doesn't produce output, and testing fou