php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #71141 Files read and written to Apache Server Root
Submitted: 2015-12-16 16:17 UTC Modified: 2015-12-18 14:02 UTC
From: lee dot traynor at skeptic dot de Assigned:
Status: Duplicate Package: imagick (PECL)
PHP Version: 7.0.0 OS: Windows XP/7/8/10
Private report: No CVE-ID: None
 [2015-12-16 16:17 UTC] lee dot traynor at skeptic dot de
Description:
------------
Affecting PHP 5.4, 5.5, 5.6 and 7.0

Functions:
constructor (i.e new Imagick ())
readImage
readImages
writeImage
writeImages

All perform relative to the Apache Server Root directory and not to the current working directory.

Test script:
---------------
$files = glob ("*.{jpg,JPG}", GLOB_BRACE);
$im = new Imagick ($files[0]);
// or
$im = new Imagick ();
$im->readImage ($files[0]);

will both fail if the image reported from the file system is not present in the 
Apache Server Root directory.

Likewise

$im->writeImage ("something.jpg");

Writes to the Apache Server Root directory and not to the current working directory.

Expected result:
----------------
This behaviour is inconsistent with most other PHP functions which read from and write to files relative to the current working directory. Absolute path has to be set each time to avoid fatal errors.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-12-18 14:02 UTC] danack@php.net
-Status: Open +Status: Duplicate
 [2015-12-18 14:02 UTC] danack@php.net
This is a duplicate of https://bugs.php.net/bug.php?id=61583

Until it is supported, please path the absolute file paths to Imagick e.g.

$im = new Imagick (realpath($files[0]));
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 15:01:29 2024 UTC