[OS X TeX] dvipng not working inside php script

Peter Dyballa Peter_Dyballa at Web.DE
Tue Jul 28 12:05:05 EDT 2009


Am 28.07.2009 um 15:58 schrieb Carter Forner:

> But the second
> command does not do anything. It should produce a png image. When I
> issue the same commands from the shell, they run fine, and I get a png
> file as the final result. dvipng is not the only program I have  
> trouble
> with...dvipdf doesn't work, nor does converting from a .ps file using
> the program convert.


You can add -d <number> (for example -1 for maximum debug output), or  
-v<number> to get information about the process of conversion.

The most likely problem your PHP environment has is that of the PATH  
environment variable. By using the absolute paths to the utilities  
you admit that *you* obviously have some problem. These utilities,  
having no IQ or Mac, have even bigger problems. And this problem is  
probably that with gs, the Ghostscript interpreter which gets used  
internally (invoked as sub-process) by dvipng and convert.

So my advise is to check the script which launches the PHP service  
and make sure the two path elements /usr/texbin and /usr/local/bin  
come early in $PATH and are exported that sub-processes can inherit  
them. Mac also sure that the way these sub-processes are created does  
*not* override this setting. If a sub-shell is created in the sub- 
process make sure that is set up using the PATH value from the PHP  
launch script, i.e., make sure no shell initialisation file  
overwrites it with some dumb assignment.

--
Greetings

   Pete

There's no sense in being precise when you don't even know what  
you're talking about.
				– John von Neumann






More information about the MacOSX-TeX mailing list