[Fontconfig] Apache/graphviz problem

Dan Yamins dyamins at gmail.com
Mon Jun 1 16:33:44 PDT 2009

On Wed, May 20, 2009 at 6:43 PM, Dan Yamins <dyamins at gmail.com> wrote:

> Hi fontconfig list:
> I'm having a problem with performance of the program "dot" (for rendering
> graphs) when called from a python cgi script, served by an apache virtual
> host.   I'm using OSX 10.5.6 and graphviz2.22 (built via macports). When I
> run a simple python script that calls dot (via a system call) to render a
> small graph, it takes a normal (short) amount of time.  But when I run the
> same call via CGI script it takes roughly 100 times longer.    I wrote to
> the Apache and graphviz lists about this problem and got the following
> response:
> A hunch is that some cache is not seen or is not available.
> Could be the fontconfig cache.  It could be the case that you
> have a ~dyamins/.fontconfig but httpd is not able to create one
> and there is no system cache.
> This seems precisely to be the problem.  I do have a ~/.fontconfig
> directory containing cache files.  When I delete it, the performance of the
> command line script is just as slow as the cgi script until the next time
> the command is run (e.g. after the cache is remade).
> So I guess the question becomes: how do I get apache and the CGI script to
> see and use the .fontconfig caches? I posted this question back to the
> apache list and got the following responses:
> > On Mac OS X Apache runs as the user www, which does indeed have its shell
> set to /usr/bin/false so you can't log in to it.
> > Maybe there's an environment variable that can be set to tell fontconfig
> to look for its caches somewhere else? You might need to ask the fontconfig
> list about that.
> >When you run your script (any script) as a cgi program under Apache, it
> runs under the user-id under which Apache itself runs.
> >That user-id may, or may not, have the same environment as when you run
> the script from the command-line, under (presumbaly) your own user-id.
> >If the environment for your own user-id includes some environment
> variables which need to be set to indicate to the script where to find
> certain things
> >What we Apache guys do not know, is what exactly your script needs as an
> environment. That is off-topic here, and you must find this out in the
> appropriate command documentation, or on some related help forum.

The answer to this problem, by the way, is the "HOME" environment variable,
containing the absolute path the user home directory.   This environment
variable was not being set in environment of the CGI script, but once it's
set explicitly, the caches are seen and run fast.

This leads to my having the following question:  if I want to set the cache
directory explicitly (e.g. to use some shared cache area instead of the one
in the user's directory), how would I do that?   Is there some environment
variable I can set other than "HOME" that fontconfig will recognize?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/fontconfig/attachments/20090601/ced010d2/attachment.html 

More information about the Fontconfig mailing list