Project

General

Profile

Actions

Bug #14830

closed

Typo3 Imagemagick static detection not working

Added by Alen Salamun almost 19 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Category:
Install Tool
Target version:
-
Start date:
2005-06-19
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
3.8.0
PHP Version:
4
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

I was just figuring out why my ImageMagick static binaries were not
detected by Typo3 in safe_mode php enviroment and came to supprising
results!

First of all I did chech that

exec('/usr/bin/convert');

actuall worked. And it DID! OK so I checked all other required files and
it also worked. But Typo3 still didn't found them. So i started to play
around with class.tx_install.php file and function checkImageMagick
which is responsible for detection.

Well somehow test failed here:

if (ini_get('open_basedir') ||
((at)file_exists($v)&&(at)is_file($v.$filename.$isExt)))

So I figured out that my "open_basedir" is empty so first one didn't
apply but also for example is_file($v.$filename.$isExt) returned false.

OK....So I did a little test:

echo exec('/usr/bin/whoami')."\n";
if (is_file('/usr/bin/whoami')){
echo "Exists: $v.$filename.$isExt\n";
}

DAMN I WAS SUPRISED!

whoami actually returned username so it executed, but is_file returned
FALSE! Beats me why!

Then I tried to play with:

is_dir('..') OK
is_dir('/') FALSE
is_file('/usr/bin/convert') FALSE
...

So when I commented out this "if" sentance that required either
open_basedir value or is_file Imagemagick started to WORK!

So there must be special cirmustance (everything is on linux server,
info follows) where Imagemagick detection FAILS even IM IS there!

  1. DEBUG SYSTEM INFORMATION - START ###
    TYPO3_PORT :
    PATH_INFO :
    QUERY_STRING : TYPO3_INSTALL[type]=phpinfo
    REQUEST_URI : /typo3/install/index.php?TYPO3_INSTALL[type]=phpinfo
    HTTP_REFERER :
    http://DELETED/typo3/install/index.php?TYPO3_INSTALL[type]=config
    TYPO3_REQUEST_HOST : http://DELETED
    TYPO3_REQUEST_URL :
    http://DELETED/typo3/install/index.php?TYPO3_INSTALL[type]=phpinfo
    TYPO3_REQUEST_SCRIPT: http://DELETED/typo3/install/index.php
    TYPO3_REQUEST_DIR : http://DELETED/typo3/install/
    TYPO3_SITE_URL : http://DELETED
    TYPO3_SITE_SCRIPT : typo3/install/index.php?TYPO3_INSTALL[type]=phpinfo
    TYPO3_SSL :
    SCRIPT_NAME : /typo3/install/index.php
    TYPO3_DOCUMENT_ROOT : /opt/sites/DELETED
    SCRIPT_FILENAME : /opt/sites/DELETED/typo3/install/index.php
    REMOTE_ADDR : 213.DELETED
    REMOTE_HOST :
    HTTP_USER_AGENT : Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
    rv:1.7.8) Gecko/20050511 Firefox/1.0.4
    HTTP_ACCEPT_LANGUAGE:
    CONST: PHP_OS : Linux
    CONST: TYPO3_OS :
    CONST: PATH_thisScri: /opt/sites/DELETED/typo3/install/index.php
    CONST: php_sapi_name: apache2filter
    OTHER: TYPO3_VERSION: 3.8.0
    OTHER: PHP_VERSION : 4.3.10
    imagecreatefromgif(): 1
    imagecreatefrompng(): 1
    imagecreatefromjpeg(: 1
    imagegif() : 1
    imagepng() : 1
    imagejpeg() : 1
    imagettftext() : 1
    OTHER: IMAGE_TYPES : 15
    OTHER: memory_limit : 32M
    SERVER: SERVER_PORT : 80
    SERVER: SERVER_SOFTW: Apache
    SERVER: GATEWAY_INTE: CGI/1.1
    SERVER: SCRIPT_NAME : /typo3/install/index.php
    SERVER: PATH_TRANSLA: /opt/sites/DELETED/typo3/install/index.php
    T3CV_GFX: image_proc: 1
    T3CV_GFX: gdlib : 1
    T3CV_GFX: gdlib_png : 0
    T3CV_GFX: gdlib_2 : 0
    T3CV_GFX: im : 1
    T3CV_GFX: im_path : /usr/bin/
    T3CV_GFX: im_path_lz: /usr/local/php/bin/
    T3CV_GFX: im_version: 0
    T3CV_GFX: im_negate_: 0
    T3CV_GFX: im_imvMask: 0
    T3CV_GFX: im_combine: combine
  2. DEBUG SYSTEM INFORMATION - END ###
    (issue imported from #M1212)

Related issues 3 (0 open3 closed)

Related to TYPO3 Core - Bug #16521: Several issues with Safe Mode On and testing for files using is_file()Closed2006-09-02

Actions
Related to TYPO3 Core - Bug #14202: ImageMagic detection fails in safe_modeClosedMichael Stucki2004-06-14

Actions
Has duplicate TYPO3 Core - Bug #14809: Safe mode: Install Tools doesn't find Image Magick even though it worksClosedMichael Stucki2005-06-10

Actions
Actions #1

Updated by Chris topher almost 14 years ago

To make a looong report short:

On Linux with safe_mode = On
in sysext/install/mod/class.tx_install.php -> checkImageMagick()
the following line returns the wrong value:

file_exists($v) && @is_file($v.$filename.$isExt)

Actions #2

Updated by Chris topher almost 14 years ago

Now it is easy to see, that this is basically part of #16521.

Resolved to solve this in #16521, so that not just one occurence of is_file(), but the whole problem can be solved in one go.

Actions #3

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF