## Installation

### Images not displaying

by Michele Rosen -
Number of replies: 7
As a test, following the Ubuntu instructions, I have imported the setdemo.def homework set into a test course. When I click on Demo, I get a warning from WW and the error:

### Warning messages

• cd /opt/webwork/webwork2/tmp/ImageGenerator.t5alFWhw && /usr/bin/latex equation > latex.out 2> latex.err failed to generate a DVI file at /opt/webwork/pg/lib/WeBWorK/PG/ImageGenerator.pm line 358.
• cd /opt/webwork/webwork2/tmp/ImageGenerator.t5alFWhw && /usr/bin/dvipng -bgtransparent -D120 -q -depth equation > dvipng.out 2> dvipng.err returned non-zero status 256: No such file or directory at /opt/webwork/pg/lib/WeBWorK/PG/ImageGenerator.pm line 364.
If I choose to view the display option as anything other than "images", ie. plaintext, jsmath, asciimath, the errors are gone. Yet, when I click on a problem, regardless of the display I've chosen, the page that loads is blank. However, if I try to edit a problem, I can see the code. So my images arent loading, but I am unsure why or how to fix it.

Thanks,
Michele

### Re: Images not displaying

by Danny Glin -
The images problem is probably the same issue I had.  One of the LaTeX packages is trying to write to a directory that doesn't exist.  If it's the same problem that I had, then running the following commands as root should fix it:

> mkdir -p /.texmf-var/web2c
> chown -R apache:apache /.texmf-var
(where apache:apache is the user:group that apache is running as.  This is the default)

This should fix the warnings in image mode, though it may have no relation to the blank screen problem.

Are there any entries in the apache error log?  These might be enlightening as to what is causing the blank screen.

### Re: Images not displaying

by Gavin LaRose -
Another thing to try to debug the images errors is to preserve temporary files which are generated in the course of creating the image files. This is controlled by the variable \$WeBWorK::ContentGenerator::Hardcopy::PreserveTempFiles in the file Constants.pm (webwork_root/lib/WeBWorK/Constants.pm). Changing it from 0 to 1 will result in files being left in (I think) webwork_root/tmp that have to do with the image generation. Often there is a clue in the log files left there that will indicate what the problem is.

Gavin

### Re: Images not displaying

by Michele Rosen -
Hi Danny,

You are right, my latex.err file is complaining that /.texmf-var/web2c directory structure does not exist. I created it and gave it the permissions apache/apache, restarted my webserver, but I am getting the same errors in the WW demo and also latex.err is still saying the same thing. Should my .texmf-var folder be located at the root, or in webwork2, etc?

Latex.out is saying it cant find the file latex.fmt, which is in the web2c directory, but is empty. There is a latex.log file in /web2c as well, and there is data in it. What should the permissions be on the latex.fmt file?

In my apache error logs I see a lot of "file does not exist" errors to the path /opt/webwork/webwork2/htdocs/tmp/equations/(random #). There is the equations directory, but the only things in there are an .svn folder and a readme, which tells me that the equation images are stored in that directory, yet its empty. Any idea why I dont have those files?

Thanks so much,
Michele

### Re: Images not displaying

by Michael Gage -
Here is a collection of FAQs on this problem:

they might help.

(When you resolve the issue please feel free to update or add to the information on that wiki page.)

-- Mike

### Re: Images not displaying

by Michele Rosen -
I have been able to clear a number of issues by turning on debugging like Gavin suggested and reading through the error logs in /webwork2/tmp/ImageGenerator.xxxx. I also looked at the troubleshooting guide that Mike sent the link for, also very helpful. Thanks to you both.

I am not longer seeing errors in the /ImageGenerator.xxxx directory and when I log into my homework set, I dont see an error there either where it lists all the problems. I was missing preview.sty, so I had to install preview-latex, which seemed to take care of a lot of issues.

I am still having some display problems though. I am viewing a homework set called MAATutorial. Some of the problems load fine, others are giving me errors like this:

WeBWorK Error

WeBWorK has encountered a software error while attempting to process this problem. It is likely that there is an error in the problem itself. If you are a student, report this error message to your professor to have it corrected. If you are a professor, please consult the error output below for more information.

### Error messages

Can't locate object method "imageName" via package "WWPlot" at line 125 of [PG]/macros/PGgraphmacros.pl Died within main::init_graph called at line 12 of [TMPL]/setMAAtutorial/hermitegraphexample.pg

### Error details

 Problem11 ERROR caught by Translator while processing problem file:setMAAtutorial/hermitegraphexample.pg **************** Can't locate object method "imageName" via package "WWPlot" at line 125 of [PG]/macros/PGgraphmacros.pl Died within main::init_graph called at line 12 of [TMPL]/setMAAtutorial/hermitegraphexample.pg
I also realized that I can not open the 'equations.dvi' file in /ImageGenerator.xxxx. Does this mean Latex is not properly installed? I do not get any errors when I run 'pdflatex check_latex.tex' from the /bin directory. I also no longer have errors in latex.err. On the left side of my site I have the option to change my display to LatexMathML (As well as several others), which doesnt seem to fix anything, but looks like I can switch over without a problem.

Thanks for any help with this.
Michele

### Re: Images not displaying

by Michele Rosen -
I just wanted to update that I was never able to find the source of my image problem. I was no longer getting errors even though debugging was turned on, so I ran out of things to track down.

I have finally rebuilt on Ubuntu and everything is working very well. The instructions for Ubuntu 10.04 were much more clear that those for CentOS and everything worked as it should right out of the gate.

Thanks to everyone for their help.

Michele