LexikMaintenanceBundle
LexikMaintenanceBundle copied to clipboard
Lock, no such file or directory
When executing the lock command, Symfony throws a ContextErrorException :
Warning: fopen(/var/www/1day-symfony/app/var/cache/lock): failed to open stream: No such file or directory
How can I fix this?
Hi, what is your Symfony version ?
The last release, Symfony3. I fixed this issue but now when I execute the command to lock the site, nothing changes.
Hi, Current configuration:
class: '\Lexik\Bundle\MaintenanceBundle\Drivers\FileDriver'
options: {file_path: %kernel.root_dir%/cache/lock}
Working configuration:
class: '\Lexik\Bundle\MaintenanceBundle\Drivers\FileDriver'
options: {file_path: /var/www/1day-symfony/var/cache/lock}
Hi @Cypaubr @gizmo-rt Do you remember which exactly symfony3 version did you use?
This issues could be caused by https://symfony.com/blog/new-in-symfony-3-3-a-simpler-way-to-get-the-project-root-directory
But %kernel.root_dir%/cache/lock
for symfony3 points to the directory with AppKernel.php
file. So, it's weird to see AppKernel.php
in /app/var/
@aivus I don't remember, but not the 3.3 for sure it was older.