php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35246 filecreation with imagepng or imagejpg fails
Submitted: 2005-11-16 20:23 UTC Modified: 2005-11-16 21:19 UTC
From: php at lucard dot nl Assigned:
Status: Closed Package: GD related
PHP Version: 4.4.1 OS: Linux
Private report: No CVE-ID: None
 [2005-11-16 20:23 UTC] php at lucard dot nl
Description:
------------
When you create an image with imagepng or imagejpeg it fails. Displaying the error message: 
Warning: imagepng(): Unable to access test.png in /opt/guide/mydomain/HTML3/test/1.php on line 6
Warning: imagepng(): Invalid filename 'test.png' in /opt/guide/mydomain/HTML3/test/1.php on line 6

The rights on the directory are open ( 777 ), with other functions we are able to write to the directory.

configline:
./configure' '--prefix=/usr/local/php4' '--with-apxs2=/usr/local/apache2/bin/apxs' '--disable-cgi' '--enable-safe-mode' '--with-openssl=/usr/local/ssl' '--with-pear' '--with-zlib' '--with-gettext' '--with-iconv=/usr' '--with-iconv-dir=/usr' '--enable-bcmath' '--enable-sockets' '--enable-calendar' '--enable-mbstring=all' '--enable-mbregex' '--with-curl=/usr/local' '--enable-dba' '--enable-dbase' '--with-dom=/usr/local' '--with-dom-xslt=/usr/local' '--with-dom-exslt=/usr/local' '--with-xmlrpc' '--enable-ftp' '--with-gd' '--with-jpeg-dir' '--with-png-dir' '--with-ttf' '--with-freetype-dir=/usr' '--enable-gd-native-ttf' '--with-imap=../imap-2004g' '--with-imap-ssl=/usr/local/ssl' '--with-ldap' '--with-mcrypt=/usr/local' '--with-mime-magic' '--with-mhash=/usr/local' '--with-mysql=/usr/local/mysql' '--with-pgsql=/usr/local/pgsql' '--with-pdflib=/usr/local' '--with-swf=../swf/dist/' '--enable-wddx' '--enable-xslt' '--with-xslt-sablot=/usr/local' '--with-expat' '--with-expat-dir=/usr/local' '--enable-exif' '--with-bz2' '--with-zip' '--enable-memory-limit'


Reproduce code:
---------------
error_reporting(E_ALL);
$destImage = imageCreateTrueColor(100, 200);
// the code works if we remove the comment before the touch
//touch("test.png");
imagepng($destImage,"test.png");



Expected result:
----------------
Nothing, the image should have been created in the current directory.

It works if we create the file first with the touch!

Actual result:
--------------
Warning: imagepng(): Unable to access test.png in /opt/guide/mydomain/HTML3/test/1.php on line 6
Warning: imagepng(): Invalid filename 'test.png' in /opt/guide/mydomain/HTML3/test/1.php on line 6

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-11-16 20:39 UTC] php at lucard dot nl
I cannot it is a shared host. And I have limited access to the system.
 [2005-11-16 21:19 UTC] tony2001@php.net
Fixed in CVS yesterday by Jani.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 04:01:30 2024 UTC