Announcement

#31 2012-11-08 19:53:41

flop25
Piwigo Team
2006-07-06
7037

Re: Backend attempting to using ImageMagic and generating http 500 error

^^ excellent
it's from photos_add_direct_prepare.inc.php line 82
and so I've just figured out why you get these apache errors
@exec($conf['ext_imagick_dir'].'convert -version', $returnarray); => to check if the binaries are there
So it's not a bug. The real problem was User tag
Glad we found it, we just turned around


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#32 2012-11-08 21:33:30

Kaz
Member
2012-11-06
18

Re: Backend attempting to using ImageMagic and generating http 500 error

flop,

We didn't really get turned around, I've been trying to point out that the default setup is causing error logs when it should not be.

Basically you're saying an repetitive apache error log entry is correct behaviour.

It 'is' a second bug, you shouldn't be checking to see if the image magic binaries are there, by using a shell execution on a file that might not exist, or even worse, accidentally executing something that was not intended.

On a server without an external imagick install, the $conf['ext_imagick_dir'] is blank, so you are in fact running "exec('convert -version', $returnarray)" on my shell.

What if I have an application or script called convert installed on my server?

You are establishing if imagick was installed using if (!extension_loaded('imagick')) in the is_imagick function, but you are not doing a similar base check in the is_ext_imagick function.

You should be.

This would be just as functional, but wouldn't create apache error logs, and wouldn't randomly execute unexpected scripts.

Code:

static function is_ext_imagick()
  {
    global $conf;

    if (!function_exists('exec') || !is_dir($conf['ext_imagick_dir']) || $conf['ext_imagick_dir']=="")
    {
      return false;
    }

Offline

 

#33 2012-11-08 21:58:59

Kaz
Member
2012-11-06
18

Re: Backend attempting to using ImageMagic and generating http 500 error

Added this summary to the first post, save anyone else with the same error needing to read through three pages of troubleshooting

---

Over the course of this thread we discovered that there were two different errors occurring:

1.) Installing the `User Tags` plugin with (at least) version 2.4.5 will cause an HTTP Error (500) when trying to upload using the flash uploader

This can be resolved by uninstalling the plugin, or using the browser upload instead.

2.) A web server that does not have Image Magick installed and is configured to auto detect graphic library (default) will attempt to execute 'convert' on the server while trying to work out which library to use. This attempt may be repeatedly logged by the web server as an error, and could - in rare situations - lead to an unexpected script being executed.

This can be resolved either by specifying GD as the library in local config ($conf['graphics_library'] = 'gd';), or by adding checks into the code (http://piwigo.org/forum/viewtopic.php?p … 57#p136957).

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2022 · Contact