Myside's Spew - Blog of Spontaneous Combustible Spew

Gallery3: ImageMagick (convert) using PHP-CGI (Fast-CGI) Patch - Bypass open_basedir, Fix for short_open_tag & Howto Disable eAccelerator Using htscanner

29 March, 2011 06:55 CST6CDT

I upgraded to Gallery3 from Gallery2 last night and had to make several accommodations for the new software with my current software systems which include: lighttpd (web server), fast-cgi (PHP), eAccelerator (opcode cacher), and htscanner (two declerations to modify PHP variables).

"I found an application, htscanner, which parses the php application directory for any .htaccess file and exports the php_value arguments. Lighttpd does not have any native .htaccess file support..."  - [read more about htscanner]

Gallery3's Gallery2 Import Module does not function fully using eAccelerator.  Also if you are using PHP-CGI (PHP Fast-CGI), the PHP variable short_open_tag is sometimes not passed to the application during installation.

The following is the .htaccess file that should be placed in the Gallery3's document root once you have installed the htscanner PHP module:

<IfModule mod_php.c>
php_value eaccelerator.enable 0
php_value short_open_tag On
</IfModule>

I was able to remove the .htaccess file and use eaccelerator after the Gallery3 installation and the Gallery2 Import.  The short_open_tag that was defined 'on' by default seemed to have started working again also after the install and import.

The following is a patch to enable ImageMagick if the 'convert' binary path is not listed in 'open_basedir' in your php.ini settings for the file 'modules/gallery/helpers/graphics.php'.  Note that you must add the path to 'convert' to the 'extra_binary_paths' and 'graphics_toolkit_path' lists in your Admin/Settings/Advaced Gallery3 web interface:

*** modules/gallery/helpers/graphics.php 2011-01-22 22:40:25.000000000 -0600
--- modules/gallery/helpers/graphics.php 2011-03-29 07:32:28.000000000 -0500
***************
*** 338,344 ****
$toolkits->$index->rotate = true;
$toolkits->$index->sharpen = true;
} else {
! $toolkits->$index->installed = false;
$toolkits->$index->error =
t("%toolkit_name is installed, but PHP's open_basedir restriction prevents Gallery from using it.",
array("toolkit_name" => $settings["name"]));
--- 338,344 ----
$toolkits->$index->rotate = true;
$toolkits->$index->sharpen = true;
} else {
! $toolkits->$index->installed = true;
$toolkits->$index->error =
t("%toolkit_name is installed, but PHP's open_basedir restriction prevents Gallery from using it.",
array("toolkit_name" => $settings["name"]));

Software  Projects  Article & Comments

Add a Comment

Verification (Required)
authimage
Your comment will appear once it is approved and
your e-mail address will NOT be shared

Main Entry:   spew   Pronunciation:   \ˈspyü\
Function: verb
Etymology: Middle English, from Old English spīwan; akin to Old High German spIwan to spit, Latin spuere, Greek ptyein   First Known Use: before 12th century

intransitive verb
  1. VOMIT
  2. to come forth in a flood or gush
  3. to ooze out as if under pressure : EXUDE
transitive verb
  1. VOMIT
  2. to send or cast forth with vigor or violence or in great quantity <a volcano spewing out ash> —often used with out —spew·er noun
Land where drunk cows swim and home to my daily hand