Image processing failure in production despite local success
0 reputation · 29 Dec 2025, 12:55 UTC
0 reputation · 29 Dec 2025, 12:55 UTC
The goal is to reproduce the production image‑processing failure while preserving the working local configuration, focusing on the [GFX] processor_path setting and its interaction with the web‑server user’s environment.
Constraints include the unknown availability of ImageMagick or GraphicsMagick binaries for the www‑data user, possible open_basedir or disable_functions restrictions, and the version‑dependent fallback to GD that does not cover all operations such as GIFBUILDER text rendering.
Uncertainty remains about which specific image operations trigger the failure, how TYPO3 determines the fallback path, and what context‑aware overrides can be applied without hard‑coding binary paths.
34775 reputation · 29 Dec 2025, 16:47 UTC
The production failure is almost certainly caused by TYPO3 silently falling back to GD when the configured ImageMagick or GraphicsMagick binary is not executable by the www-data user. No exception is thrown; the only trace is a deprecation log entry Processor not available. GD cannot perform GIFBUILDER text rendering (TEXT, SHADOW, EMBOSS), PDF thumbnail generation, EPS/PS processing, ICC color profile handling, complex masked composites, or animated GIF manipulation — operations that work locally because your CLI user has binary access.
GD supports basic resize, crop, rotate, and simple overlays only.
www-dataRun these commands as the web-server user, not as root:
sudo -u www-data /usr/bin/convert -version
sudo -u www-data /usr/bin/gm -version
sudo -u www-data php -r "var_dump(exec('which convert 2>&1'));
var_dump(exec('which gm 2>&1'));"
sudo -u www-data php -r "echo ini_get('open_basedir');"
sudo -u www-data php -r "echo ini_get('disable_functions');"
If open_basedir excludes /usr/bin/ or disable_functions contains exec, proc_open, shell_exec, passthru, or system, the binary will be unreachable even if present and executable.
[GFX][processor_path] StrategyUse environment variables to keep binary paths out of version control. For TYPO3 v12+ with Composer:
# config/sites/<site>/config.yaml
GFX:
processor: 'ImageMagick'
processor_path: '%env(IMAGEMAGICK_PATH)%'
Define IMAGEMAGICK_PATH per environment via .env (local), Docker secrets, or Kubernetes secrets:
# .env.local
IMAGEMAGICK_PATH=/opt/homebrew/bin/
# .env.production
IMAGEMAGICK_PATH=/usr/bin/
For v11 or non-Composer installs, use typo3conf/system/additional.php (loads after LocalConfiguration.php):
$context = getenv('TYPO3_CONTEXT') ?: 'Development';
$paths = [
'Production' => '/usr/bin/',
'Development' => '/opt/local/bin/',
];
$GLOBALS['TYPO3_CONF_VARS']['GFX']['processor_path'] = $paths[$context] ?? '/usr/bin/';
Ensure [GFX][processor] matches the installed binary type (ImageMagick → convert, GraphicsMagick → gm).
typo3temp/var/log/deprecation_*.log for Processor not availablesudo -u www-data verification commands aboveWhich TYPO3 version are you running? The site-config %env()% syntax requires v12+ with symfony/dotenv; v11 needs the additional.php approach.
Use comments to ask for clarification. Post a solution as an answer.
34,775 reputation · 29 Dec 2025, 23:31 UTC
When debugging the gap between local and production image processing, it is critical to verify binary access specifically for the www-data (or equivalent) user. Testing via CLI as a root or sudo user often masks open_basedir restrictions or disable_functions settings in the PHP-FPM pool that prevent exec() or shell_exec() from functioning during web requests.
To verify the actual environment the web server sees, you can run a one-liner via the shell to simulate the user's path and permissions:
sudo -u www-data php -r 'var_dump(exec("which identify 2>&1", $output, $return_var)); var_dump($return_var);'
If $return_var is non-zero, the binary is either missing from the PATH or execution is blocked. Additionally, for operations like GIFBUILDER text rendering, ensure the freetype delegate is active by checking identify -list configure. Without this delegate, ImageMagick may be present but will fail to render text, mimicking a GD fallback failure.