Bug #16950
closedexec() with ImageMagick/GraphicsMagick fails on Windows with safe_mode = On
100%
Description
On Windows-Systems with safe_mode = On the exec()-Command for ImageMagick/GraphicsMagick fails.
It's not possible to run TYPO3 correct with IM e.g. GM when safe_mode is On.
Same Problem in TYPO3 4.0.2 and 4.0.4
Tested with PHP 4.4.4 and PHP 5.0.2
Affected File: t3lib/class.t3lib_div.php
Function: imageMagickCommand
Solution: Unset the path when on Windows and safe_mode = On, see the Code-Snippet below
function imageMagickCommand($command, $parameters, $path='') {
$gfxConf = $GLOBALS['TYPO3_CONF_VARS']['GFX'];
$isExt = (TYPO3_OS=='WIN' ? '.exe' : '');
$switchCompositeParameters=false;
if(!$path) { $path = $gfxConf['im_path']; }
> if ((TYPO3_OS=='WIN') and (ini_get('safe_mode')==1) ) {
> $path = '';
-> }
(issue imported from #M4937)
Updated by Martin Kutschker almost 18 years ago
Put IM into the safe_mode_exec_dir directory. See http://www.php.net/manual/en/features.safe-mode.php.
Updated by Andreas Eberhard almost 18 years ago
Hi Martin,
I have forgotten to say that it happens on Windows XP.
I have no Windows 2003 Server to test this.
GM resides in the safe_mode_exec_dir!
Only the exec()-Command has to be changed without leading path.
My Settings:
safe_mode On
safe_mode_exec_dir /Programme/TYPO3_4.0.2/GraphicsMagick/
With my Hack:
exec('gm.exe identify -version') works fine !
Without my Hack:
exec('/Programme/TYPO3_4.0.2/GraphicsMagick/gm.exe identify -version') fails !
regards, Andreas
Updated by Alexander Opitz over 11 years ago
- Status changed from New to Needs Feedback
- Target version deleted (
0) - TYPO3 Version changed from 4.1 to 4.0
- PHP Version changed from 4 to 5.0
The issue is very old, does this issue exists in newer versions of TYPO3 CMS (4.5 or 6.1)?
Updated by Chris topher over 11 years ago
- Status changed from Needs Feedback to Closed
- % Done changed from 0 to 100
safe_mode
is deprecated in PHP - or even already removed. Anyway: Current versions of TYPO3 do not support safe_mode=On
anymore. Without safe_mode ImageMagick/GraphicsMagick are generally working.