Hi, I have a site that’s been running for a few years, today I saved some images via the admin plugin and then got the following error:
E_NOTICE - tempnam(): file created in the system's temporary directory
And now I’m locked out of admin and visitors to the site get the same error - has anybody else had this?
It was a server overload problem, due to the cache files growing too much. This seems to be a common re-occurrence and I’m not sure how to solve it.
you could set up a cron job, or use grav’s built in scheduler to clear the cache, as they have a built in rule already setup.
Or it can be done manually either by
bin/grav cache --all on your server as a command line, or simply go in to the admin and press the ‘clear cache’ button.
You server might also have tool / something built in to run a task, or remove files xxx days old
Grav needs caches, because it is what makes it fast.
Like anything , think of grav like a car, if you dont show it some love and maintain it, that it will break down.
As an admin, you need to check in now and then, and do a bit of housekeeping !
The strange thing is that I do empty the cache regularly - and I’d emptied it via the admin plugin button two days prior.
The site gets its fair share of TLC as I publish regularly and often tinker with the theme, so there’s something different going on.
I end up going onto the server to empty the cache.
All I can suggest if it is getting full that quickly, it sounds like maybe that you may have a lot of web crawlers indexing your site, so it is producing / creating a cache of all the elements thus filling it up so quickly .
Ensure that your site is running the latest grav version and up to date,
Ensure your site permissions are set up correctly on your web server.
Is there any plugin that you are using to provide search / indexing of the site which could be causing it ?
check your php settings for accelerators and caches settings.
Performance & Caching | Grav Documentation (getgrav.org)
Scheduler | Grav Documentation (getgrav.org)
Specifically this area
cache-purge / cache-clear
Also check if you have automated backups running , which will fill up the disk quickly
Also your hoster maybe to help to purge the cache or at least set a limit on the directory on the data size, so when its reached, it will basically overwrite the oldest elements in the cache .
try and block bots which are going to be scanning the site regularly , for good or bad purposes … and check your .htaccess / web server logs and try and use settings to block anything that looks untoward.
Thanks for this advice - I’m away from the office and didn’t reply but wanted to say thankyou. From memory there were a lot of web crawler visits, so I’ll look into that.
I always keep Grav up to date, same with plugins. I use simplesearch, I don’t think it overloads cache, but will check.
No automated backups, so its not that.
Currently running at about 45k unique visits a month, so the server isn’t getting any untoward pressure from anywhere else…