简体   繁体   中英

How can I fix the caching issue in TYPO3 and ddev?

I recently got into using ddev to develop TYPO3 pages, but I run into the same issue every once in a while. Sometimes (I don't really know what's causing this issue) the page just stops loading and after a while this errormessage appears:

PHP Warning
Core: Error handler (BE): PHP Warning: rename(/var/www/html/var/cache/code/cache_core/5d5a7572dd900787722599.temp,/var/www/html/var/cache/code/cache_core/site-configuration.php): No such file or directory in /var/www/html/public/typo3/sysext/core/Classes/Cache/Backend/SimpleFileBackend.php line 234

I know that this error appears when TYPO3 has no permission to write cache but I don't know what I can do to prevent this issue. Restarting Docker fixes it for a short while but eventually it's happening again and this really costs a lot of time to restart Docker every 10 to 20 minutes.. Does anybody know what kind of configuration I need to do to prevent this issue?

Btw, I'm using Docker on Windows with TYPO3 9.5.8

As there is no official accepted answer yet I'll elaborate on what has been said:

The issue can be resolved by following Susis example in the comments of the initial post: Create a docker-compose.tempfs.yaml in the .ddev directory (look carefully for the spaces indent!)

version: '3.6'

services:
  web:
    volumes:
      - type: tmpfs
        target: /var/www/html/var
        tmpfs:
          size: 268435456

Combining this with the setup for NFS described in https://ddev.readthedocs.io/en/stable/users/performance/ also increases performance. Mind: The most feasible approach for using NFS seems to be creating your own package directory which you include via composer "path" repository inside the ddev directory which already gets mounted. (eg. /projectname/Packages/Vendor.MyPackage) Mounting directories above the ddev directory is complicated and prone to error when using symlinks.

I have the same problem and tried it with the yaml file but after I created the file and starte ddev I got the error: Uncaught RuntimeException: Could not create directory "/var/www/html/var/log/"!

Did someone have a hint? I also deleted the var folder. after deletion the page runs withoiut issue but after restart ddev the error reappears.

I'm on Mac.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM