imagecache icon indicating copy to clipboard operation
imagecache copied to clipboard

storage/cache directory not building out

Open MarcusThatsMe opened this issue 9 years ago • 4 comments

Hello,

I'm trying to implement imagecache, but I'm running into a road block and Google isn't being helpful this time with my searches...

This is the error I get:

Warning: file_put_contents(/home/mysite/cms-core/vendor/intervention/imagecache/src/Intervention/Image/../../../storage/cache/66/ac/66ace94b6ef87887606f05a087fa0fed): failed to open stream: No such file or directory in /home/mysite/cms-core/vendor/illuminate/filesystem/Filesystem.php on line 75

I go to the "cache" directory and its empty.

Here is my call:

$imageURL = "https://s3.amazonaws.com/bucketName/fileName";

Image::configure(array('driver' => 'imagick')); $img = Image::cache(function($image) use ($imageURL) { return $image->make($imageURL); });

print_r($img);

It runs through and I seem to get the image contents as output with my print_r, however, I receive the above error and the cache directory is empty, so I'm not sure what I'm doing wrong. Is it that I'm not using Laravel? I'd imagine all the needed files would have been downloaded through the composer install? Well any help would be appreciative.

MarcusThatsMe avatar Nov 10 '15 18:11 MarcusThatsMe

did you check that your storage directory is writable by the web server?

stevethomas avatar Feb 12 '16 05:02 stevethomas

Why would you want the vendor folder in Composer to be writable. When the package is updated the folder is overwritten. Its simply bad-practice having storage inside a php-package. We, as users, should be able to define where the cache is stored.

HMAZonderland avatar Aug 25 '16 13:08 HMAZonderland

Did anyone find a solution to this? Not using laravel, only fix is to set permissions on /vendor/intervention/imagecache/storage/cache Which will surely be erased in the event of a package update.

broakenmedia avatar May 28 '19 15:05 broakenmedia

halo, did anyone find a solution?

adesm avatar Jun 08 '20 04:06 adesm