AlexanderKim's avatar

[L4] ImageCache 500 internal server error

Here's my: app/config/packages/intervention/imagecache/config.php:

return array(

    /*
    |--------------------------------------------------------------------------
    | Name of route
    |--------------------------------------------------------------------------
    |
    | Enter the routes name to enable dynamic imagecache manipulation.
    | This handle will define the first part of the URI:
    | 
    | {route}/{template}/{filename}
    | 
    | Examples: "images", "img/cache"
    |
    */
   
    'route' => 'imagecache',

    /*
    |--------------------------------------------------------------------------
    | Storage paths
    |--------------------------------------------------------------------------
    |
    | The following paths will be searched for the image filename, submited 
    | by URI. 
    | 
    | Define as many directories as you like.
    |
    */
    
    'paths' => array(
        public_path('upload')
    ),

    /*
    |--------------------------------------------------------------------------
    | Manipulation templates
    |--------------------------------------------------------------------------
    |
    | Here you may specify your own manipulation callbacks.
    | The keys of this array will define which templates 
    | are available in the URI:
    |
    | {route}/{template}/{filename}
    |
    */
   
    'templates' => array(
        'xtra-small' => function($image) {
            return $image->fit(120, 90);
        },        
        'vertical-artist' => function($image) {
            return $image->fit(224, 336);
        },        
        'horizontal-artist' => function($image) {
            return $image->fit(960, 336);
        },
        'square-artist' => function($image) {
            return $image->fit(228, 228);
        },
        'artist-small' => function($image) {
            return $image->fit(111, 85);
        },        
        'artist-big' => function($image) {
            return $image->fit(480, 352);
        },
        'artist-full' => function($image) {
            return $image->widen(600);
        },                
        'partner' => function($image) {
            return $image->fit(150, 150);
        },
        'small' => function($image) { 
            return $image->fit(159, 159);
        },
        'big' => function($image) {
            return $image->fit(640, 640);
        },
        'medium' => function($image) {
            return $image->fit(240, 180);
        },
        'large' => function($image) {
            return $image->fit(480, 360);
        }

    ),

    /*
    |--------------------------------------------------------------------------
    | Image Cache Lifetime
    |--------------------------------------------------------------------------
    |
    | Lifetime in minutes of the images handled by the imagecache route.
    |
    */
   
    'lifetime' => 43200,

);

My images stored in 'public/upload' directory which has the right permissions and owner.

When i access imagecache route: http://iartist.kz/imagecache/vertical-artist/img_1505-550fada322e96.jpg

I get Whoops error complaining about createDriver()

However if i access the image directly from the upload folder: http://iartist.kz/upload/img_1505-550fada322e96.jpg

It does work. What's wrong with imagecache?

0 likes
2 replies
davidfaux's avatar

Have you added the service provider in config\app.php?

'Intervention\Image\ImageServiceProvider'

Please or to participate in this conversation.