Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We have a web server (Debian, with Apache2, PHP4 and MySQL) used in an Intranet. It's main use is to serve pages with data and graphs generated dynamically (using jpgraph) from the data stored in DB.

It has worked rock solid for several years, but this week we have found that everything related to graphs is not working. This includes jpgraph and gnuplot generated figures, both dependent on library gd. Also there are no references to "gd" in phpinfo(), and any direct call to gd functions (like gd_info()) results in an error.

We have tried to reinstall php4-gd (and restarting Apache) with no result. Obviously we have done something wrong, but we cannot figure out what it is.

What can we have done? Is there any other diagnosis we can do to isolate the problem?

Thanks.

share|improve this question

3 Answers 3

Problem solved. Checking apache log /var/log/apache2/error.log the following line was detected after each restart:

PHP Warning: Unknown(): Unable to load dynamic library '/usr/lib/php4/20050606+lfs/gd.so' - /usr/lib/php 4/20050606+lfs/gd.so: undefined symbol: gdImagePngCtx in Unknown on line 0

The problem was solved by a combination of adding the line: extensions_dir = "/usr/lib/php4/20050606+lfs/ to /etc/php4/apache2/php.ini and doing what is described in bugs.debian.org, that basically is to move away from /usr/local/lib all libgd.so* libraries (?).

Don't ask me why, but after restaring Apache everything worked fine again. Still don't know what we did... Of course, probably is time for a full server reinstall and upgrade.

Thanks for your interest.

share|improve this answer

Assuming that you kept everything in packages, take a look in /var/log/dpkg.log for any packages that were changed (installed, upgraded or removed) around the time that everything fell apart.

The other likely problem is that the extension line in php.ini for the gd plugin has gone a-wandering; It should be towards the bottom of /etc/php4/apache2/php.ini (or similar); add it if it's missing and restart Apache, see where that gets you.

share|improve this answer

Is it possible that you have multiple versions of PHP installed on the machine, some with gd support and some without and that you are linking to the wrong one?

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.