From DreamHost
Jump to: navigation, search

One Click Installs

Box piwigo.png

Piwigo is an open source photo gallery software for the web.

Piwigo 2.6.2, released in March 2014, is available as a one-click install from the the Goodies tab of your Control Panel.

(Note: As of November 2014, the latest stable version is Piwigo 2.7.1, released in October 2014.)

Troubleshooting: I/O Error when uploading photos


[Wed Feb 05 11:14:18 2014] [error] [client xx.xx.xx.xx] ModSecurity: Input filter: Failed writing 1460 bytes to temporary file (rc 694). [hostname "example.org"] [uri "/piwigo/admin/include/uploadify/uploadify.php"] [unique_id "xxxxxxxxxxxxxxxxxxxxxxxx"]


Troubleshooting: Timeout when resizing photos


[Wed Feb 05 18:33:06 2014] [error] [client xx.xx.xx.xx] Premature end of script headers: i.php, referer: http://example.org/piwigo/index.php?/category/1

Solution, Part 1: Use ImageMagick

According to http://piwigo.org/doc/doku.php?id=user_documentation:faq:pictures_missing#using_imagemagick:

ImageMagick is much more efficient than the GD Graphics Library: less resource consumption on the server and higher quality pictures rendered. Many problem can be solved by changing the graphical library from GD to IM, and your hoster will be glad.

You may activate and use the built-in LocalFiles Editor plugin to edit "Local config", i.e. local/config/config.inc.php on the server. The following setting is appropriate for DreamHost shared hosting, where ImageMagick is installed system-wide as /usr/bin/convert:


// Library used for image resizing. Value could be 'auto', 'imagick',
// 'ext_imagick' or 'gd'. If value is 'auto', library will be choosen in this
// order. If choosen library is not available, another one will be picked up.
$conf['graphics_library'] = 'ext_imagick';

// If library used is external installation of ImageMagick ('ext_imagick'),
// you can define the path to ImageMagick.
$conf['ext_imagick_DIR'] = '/usr/bin/convert';


Solution, Part 2: Use Batch Manager to pre-generate multiple size images

  • Photos → Batch Manager, Global mode
  • Filter: Pre-defined filter: All
  • Selection: The whole set
  • Action: Generate multiple size images

This would generate all the thumbnails one at a time using ImageMagick /usr/bin/convert. It may take a while depending on the size and number of photos you have. You may expect about 5 seconds per resize for full-resolution photos taken with modern digital cameras. Thankfully, a DreamHost shared-hosting server is quite happy to let this process run without interruption. Thumbs up for DreamHost!  :-)

Solution, Part 3:

To reduce server loads, recent versions of Piwigo use AJAX to load 3 thumbnails at a time rather than the old method of loading (e.g. 30) displayed thumbnails all at once. (See the discussion at [multisize] AJAX load for thumbnails for details.) Unfortunately, for high resolution photos, resizing 3 thumbnails at a time, resulting of 3 or 4 instances of ImageMagic /usr/bin/convert each taking over 90% CPU running simultaneously, is too much for DreamHost shared hosting, and often most of the thumbnails would fail to load.

I recommend editing thumbnails.loader.js to reduce that max_requests from 3 to 1:

$ diff -Nur piwigo~/themes/default/js/thumbnails.loader.js piwigo/themes/default/js/thumbnails.loader.js
--- piwigo/themes/default/js/thumbnails.loader.js	2013-01-17 10:38:54.000000000 -0800
+++ piwigo/themes/default/js/thumbnails.loader.js	2014-11-10 19:03:42.899058253 -0800
@@ -1,5 +1,5 @@
 if ( typeof( max_requests ) == "undefined" )
-  max_requests = 3;
+  max_requests = 1;
 var thumbnails_queue = jQuery.manageAjax.create('queued', {
   queue: true,  

External Links