php-docs-samples
php-docs-samples copied to clipboard
Unable to set cache path on appengine.
Since all Directories are read only, I am unable to set a cache path on app engine. I have tried to overide the config by using database as the drive but no success, could anyone assist please InvalidArgumentException
Please provide a valid cache path.
The cache path can be set to /tmp
, which is writeable and ephemeral (it will be destroyed once the instance shuts down).
Which sample are you running?
If you're running Symfony, put the following in your Kernel
class in src/Kernel.php
:
public function getCacheDir()
{
if ($this->environment === 'prod') {
return sys_get_temp_dir();
}
return parent::getCacheDir();
}
public function getLogDir()
{
if ($this->environment === 'prod') {
return sys_get_temp_dir();
}
return parent::getLogDir();
}