TrueStory
TrueStory

Reputation: 439

Configuring Laravel 4 with AWS Elasticache Memcached

I have Amazon Elasticache Memcached node (just one) I have a webserver in the same region.

Cache subnet group VPC ID is the same as EC2 instance's, the permissions are set properly from AWS perspective.

In laravel in config/cache.php

'driver' => 'memcached',

and

'memcached' => array(
        array('host' => 'xxxxx.xxxx.xxx.xxxx.cache.amazonaws.com', 'port' => 11211, 'weight' => 100),
),

However, Cache::has('key') and Cache::add('key'); do not work.

Do I need a special package for Laravel to work with AWS Elasticache? I only have one node and do not need auto-discovery.

Thanks

P.S. Is there way to get a log for AWS Elasticache? or laravel? logs directory is empty

Upvotes: 1

Views: 3504

Answers (1)

snipe
snipe

Reputation: 510

You should be able to use the elasticache-laravel package, available here: https://github.com/atyagi/elasticache-laravel

Or conversely, check out this post: http://blog.hapnic.com/2013/09/11/Laravel-4-and-ElastiCache/

For your PS: Elasticache logs can be accessed this way: http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/ManagingEvents.html

Your Laravel logs should be in app/storage/logs - if there's nothing in there, check the permissions of the storage directory and make sure it's writeable by the web server. Barring that, check the default error log location for your web server (such as /var/log/httpd/error_log), as defined by your server configuration.

Upvotes: 2

Related Questions