Bug #102736
openInstall Tool Configuration Presets broken for image handling settings with debug mode enabled
0%
Description
Hello,
Upgrade from 11.5.33auf 12.4.9.
If "Configuration Presets" ist set to Debug the "Configuration Presets" is broken. It returns an AJAX Error:
Core: Error handler (BE): PHP Warning: file_exists(): open_basedir restriction in effect. File(/opt/local/bin/identify) is not within the allowed path(s): (/usr/bin/) in /typo3_src-12.4.9/typo3/sysext/install/Classes/Configuration/Image/ImageMagick6Preset.php line 81
Core: Error handler (BE): PHP Warning: file_exists(): open_basedir restriction in effect. File(/opt/local/bin/gm) is not within the allowed path(s): (/usr/bin/) in /typo3_src-12.4.9/typo3/sysext/install/Classes/Configuration/Image/GraphicsMagickPreset.php line 77
Temporär solution set "Configure Installation-Wide Options" -> [GFX][processor_path] from /usr/bin/ to /usr/bin. Then "Configuration Presets" load without error. Set Debug mode to off an then you can use "Configuration Presets" again to switch preset between GraphicsMagick and ImageMagick6.
Updated by Arne Bracht about 1 year ago
So, the error comes from:
if (!file_exists($binaryPath) || !is_executable($binaryPath))In Debug mode the php warning breaks the preset setup.
What about this suggestion: Ad a if(@is_readable($path)) to avoid the warning, befor the file_exists check? Works in both files ImageMagick6Preset.php and GraphicsMagickPreset.php Sorry that I don't have the knowledge to make it as a patch request.
protected function findImageMagick6InPaths(array $searchPaths)
{
$result = false;
foreach ($searchPaths as $path) {
if (Environment::isWindows()) {
$executable = 'identify.exe';
if (!@is_file($path . $executable)) {
$executable = 'magick.exe';
}
} else {
$executable = 'identify';
}
if(@is_readable($path)) {
$binaryPath = $path . $executable;
if (!file_exists($binaryPath) || !is_executable($binaryPath)) {
continue;
}
$command = escapeshellarg($binaryPath) . ' -version';
$executingResult = [];
CommandUtility::exec($command, $executingResult);
// First line of exec command should contain string GraphicsMagick
$firstResultLine = array_shift($executingResult);
// Example: "Version: ImageMagick 6.6.0-4 2012-05-02 Q16 http://www.imagemagick.org"
if (is_string($firstResultLine) && str_contains($firstResultLine, 'ImageMagick')) {
[, $version] = explode('ImageMagick', $firstResultLine);
// Example: "6.6.0-4"
[$version] = explode(' ', trim($version));
if (version_compare($version, '6.0.0') >= 0) {
$this->foundPath = $path;
$result = true;
break;
}
}
}
}
return $result;
}
Updated by Stefan Bürk about 1 year ago
- Assignee set to Stefan Bürk
Simply suppressing the warning is not a real solution, and should only be used
where there is absolutly no way arround. Not sure about a proper solution directly,
but will put it on my list to recheck this and create a patch then.
Updated by Garvin Hicking 10 months ago
- Is duplicate of Bug #101778: Configuration Presets open_basedir added
Updated by Vincent Mans 7 months ago
Here too, in 12.4.15, PHP8.3
The same error.
Priority should be MUST since it breaks the Configuration Presets!
Updated by Garvin Hicking 6 months ago · Edited
- Status changed from New to Closed
Updated by Garvin Hicking 6 months ago
- Related to Bug #100021: Incorrect path because of absolutely reference file(s) in typo3/cms-dashboard plus it causes open_basedir warnings added
Updated by Garvin Hicking 6 months ago
- Status changed from Closed to Accepted
- Priority changed from Should have to Must have
(This issue was falsely closed due to its dupe. Re-opening now and adapting to the other issue)
Updated by Marco Kuprat about 2 months ago
This issue has been around since a while. Any update?
Updated by Garvin Hicking about 1 month ago
- Related to Bug #101350: open_basedir restriction in effect added