Mugoma J. Okomba Mugoma J. Okomba - 1 year ago 161
PHP Question

Laravel: Use absolute path for cache folder

We are using Lavarel 5 and would like cache folder separate from main application (probably even a different drive).

In config/cache.php we have:

'file' => [
'driver' => 'file',
//'path' => storage_path('framework/cache'),
'path' => storage_path('<ABSOLUTE_PATH>'),

However, Laravel in not using
. Instead it creates
. In other words it interprets
as a relative path.

How can we set absolute path for cache?

Answer Source

Remove the storage_path function from the string to put an absolute path in...

'path' => '/var/www/blah/'
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download