|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2021-07-08 13:10 UTC] meelmva at hotmail dot com
Description:
------------
When creating a pseudo image with newPseudoImage() and a pseudoString "canvas:white" a ImagickException is thrown with the message:
open_basedir restriction in effect. File(canvas:white) is not within the allowed path(s) in /path/to/script.php
When running the script on PHP 7.4.20 no error is given.
To test this, make sure that the open_basedir configuration option is set to the current directory containing the test script.
Test script:
---------------
<?php
ini_set('display_errors', 1);
error_reporting(E_ALL);
$blankPage = new \Imagick();
$blankPage->newPseudoImage(10, 10, "canvas:white");
echo 'finished';
Expected result:
----------------
newPseudoImage should not throw a Exception and "finished" should be printed.
Actual result:
--------------
A ImagickException is thrown.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 09:00:01 2025 UTC |
Same problem here on PHP 7.4.39 running on 4.19.0-0.bpo.16-amd64 #1 SMP Debian 4.19.181-1~deb9u1 (2021-03-29) x86_64. My hosting provider allows me to roll back to an older version, and the code works flawlessly there. Code ---: <?php $youtube_background = new Imagick(); $youtube_background->newPseudoImage(2560, 1440, "canvas:black"); ... Output on PHP 7.4.39 -------------------: Fatal error: Uncaught ImagickException: open_basedir restriction in effect. File(canvas:black) is not within the allowed path(s) in /var/www/html/XXX/index.php:3 Stack trace: #0 /var/www/html/XXX/index.php(3): Imagick->newpseudoimage(2560, 1440, 'canvas:black') #1 {main} thrown in /var/www/html/XXXindex.php on line 3 Output on PHP 7.3.29: --------------------: [generates the image like itʼs supposed to]