Verified against Semitexa Ultimate 2026.10.03.1952
Twig Template Cache
The only supported way to run a Semitexa application is via Docker, driven by bin/semitexa from the project root on the host.
- Start:
bin/semitexa server:startrunsdocker compose upwithdocker-compose.ymlplus the overlays your.envasks for:docker-compose.mysql.ymlwhenDB_DRIVERis set,docker-compose.redis.ymlwhenREDIS_HOSTis set,docker-compose.nats.ymlwhenEVENTS_ASYNC=1,docker-compose.ollama.ymlwhenLLM_PROVIDER=ollama, anddocker-compose.override.ymlif it exists. - Stop:
bin/semitexa server:stopstops every service from all of those files. - Restart the app only:
bin/semitexa server:restart app. - Logs:
bin/semitexa logs:appfor the application log;docker compose logs -f appfor the container output.
docker-compose.yml defines four services: app (the Swoole server, php server.php, listening on SWOOLE_PORT, default 9502), setup (runs Composer before the app starts), and scheduler and cli, which only start when their Compose profile (demo, cli) is enabled. Do not run php server.php on the host as the primary way to run the app.
bin/semitexa exists only on the host. Inside a container the same console is php vendor/bin/semitexa, for example docker compose exec app php vendor/bin/semitexa cache:clear. Any command bin/semitexa does not handle itself is forwarded to that console in the app container.
Twig template cache
Twig compiles templates into var/cache/twig/, and every Swoole worker also keeps the compiled templates it has loaded in memory for its whole life. So an edited template can stay invisible, or show up in some responses and not others, until the workers are cycled.
- CLI (recommended):
bin/semitexa cache:clearclears Twig and the other framework caches and cycles the running workers. Add--twigto clear only the Twig cache, or--no-reloadto leave the workers alone. - Permission denied: the cache directory is created by the container, often as root, so a clear that runs as your host user can fail.
bin/semitexa cache:clear --via-dockerruns the clear inside the app container, which can delete the files. - Simplest reset:
bin/semitexa server:restart appstarts fresh workers.
The framework also uses a writable fallback (system temp) when var/cache/twig is not writable, so the app keeps working; clearing the cache is only needed when you change templates or template paths and want to avoid stale compiled files.