Troubleshooting Image Cache

ImageCache makes use of several advanced PHP and Apache features, such as URL rewriting and the GD image library. Because its software requirements are steep, any misconfiguration in your server or Drupal setup may cause ImageCache to break. The following sections describe common problems when getting ImageCache to work.

Check Clean URLs

The most common problem is that Clean URLs are not enabled (or not supported by the software on the web server). Visit Administers Site configurationsClean URLs (admin/settings/clean-urls), as shown in Figure 7-17. If you receive an error on the configuration form, see the handbook page for setting up Clean URLs (http://drupal .org/node/15365) for help configuring your server.

Drupal's Clean URLs feature requires the Apache extension mod_rewrite. If running Drupal on a Microsoft IIS webserver, a third-party solution for rewriting URLs will be necessary to use ImageCache.

Clean URLs

Clean URLs:

8 Disabled C Enabled

This option makes Drupal emit 'clean" URLs (I.e. without ?q= in the URL], Your server has been successfully tested to support this feature.

( Save configuration) ( Reset to defaults )

Figure 7-17. Clean URLs cannot be enabled until the Clean URL test has successfully run

Check GD library

Another common problem is a lack of the GD image library on the server. This could be the problem if no image is being generated at all when manually visiting an ImageCache URL. GD is a software package that is enabled by default with installations of PHP, but sometimes it is missing from the installation when doing custom installs of PHP. You can check the status of GD in your installation by visiting Adminis-tersReportssStatus report (admin/reports/status). You should see a message similar to Figure 7-18, confirming GD is enabled.

Figure 7-18. The message you should see for GD on the Status report

If GD looks OK but you're still not having images generated, try checking the full configuration of your PHP installation by creating an info.php file on your server containing only the following line of code: <?php phpinfo(); ?>

You can also view an abbreviated list of PHP info right from Drupal by going to Ad-ministersReportssStatus report and clicking on the version number link next to PHP (admin/reports/status/php). While not as complete as the full info.php file, it can be useful for checking overall details of how PHP is configured on your server.

ftp

GD Support

enabled

GD Version

bundled (2.0.34 compatible)

Freeiype Support

enabled

FreeType Linkage

with Ireetype

Freely pe Version

T1 Lib Support

ënablêX

GIF Read Support /

enabled \

GIF Create Support /

enabled

JPG Support

enabled

PNG Support 1

enabled

WBMP Support \

enabled / tuiiaiiuic.

XBM Support \

gabled/

hash

Figure 7-19. Checking for GD in a PHP install

Figure 7-18. The message you should see for GD on the Status report

Check for the GD settings section, which should be similar to Figure 7-19. Check that all the needed libraries are available for the kinds of images being uploaded. If the entire section is missing from this page, then GD is not installed at all.

When finished with info.php, you should delete it from your server. It gives away lots of details about how your server is configured, which could give ideas to someone with less-than-honorable intentions if he happens across it.

Was this article helpful?

0 0

Post a comment