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.