1

On my local server, I am able to create an image with GD and then export it using imagepng($imgResource, $path)

I am trying to deploy to an AWS instance, and on the AWS instance I always receive an error Unable to open 'public://pictures/pic.png' for writing: No such file or directory in mymodule_myfunction_form_submit()

The directory definitely exists - I can actually call imagecreatefrompng($src) on an image that's in that directory, and it creates a GD resource. Then, when I try to imagepng($img, $path) that exact same GD resource back into the same folder, it spits out that same error.

I have even set the privileges on the directory to be 777, owner/group is apache:apache, yet I receive the same error every time.

I am running GD (libPNG v1.2.49) on PHP 5.3.27 on my remote server and GD (libPNG v1.2.50) on PHP 5.4.16 on my local server.

tigertrussell
  • 521
  • 2
  • 13
  • 1
    GD functions in older version of PHP don't support stream wrappers. I don't remember exactly when it was enabled. In my own code, I often resort to output buffering to capture the compressed image data. – cleong Sep 25 '13 at 13:33
  • That's actually what I did! – tigertrussell Sep 25 '13 at 13:50

0 Answers0