Cannot obtain dvipng version

I am trying use matplotlib on CentOS through a PHP script. If I run it on the command line it works fine and generates a PNG figure. If I run with another user,

sudo -u apache python filename.py

it gives error: Cannot obtain dvipng version.

Any ideas? I search the net but no answers. It looks like a bug? In the script I am using TeX.

rc(‘text’, usetex=True)

Texlive and dvipng are installed and paths are set correctly.

It is a security feature. The apache user is limited by selinux. I
don't know how to address this, but selinux is where you should look.

Ben Root

PS - Don't succum to the temptation to simply turn off selinux. There
are easy ways to create exception modules using sealert and other
tools. Selinux is a very important part of the security mechanisms
for Linux.

···

On Sunday, May 15, 2011, Alice Marcot <alice.inside.mirror@...287...> wrote:

I am trying use matplotlib on CentOS through a PHP script. If I run it on the command line it works fine and generates a PNG figure. If I run with another user,

sudo -u apache python filename.py

it gives error: Cannot obtain dvipng version.

Any ideas? I search the net but no answers. It looks like a bug? In the script I am using TeX.

rc('text', usetex=True)

Texlive and dvipng are installed and paths are set correctly.