lexik / LexikMaintenanceBundle

This Symfony2 bundle allows you to place your website in maintenance mode by calling two commands in your console. A page with status code 503 appears to users, it is possible to authorize certain ips addresses stored in your configuration.
MIT License
257 stars 90 forks source link

Lock, no such file or directory #61

Open Cypaubr opened 7 years ago

Cypaubr commented 7 years ago

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?

sdieunidou commented 7 years ago

Hi, what is your Symfony version ?

Cypaubr commented 7 years ago

The last release, Symfony3. I fixed this issue but now when I execute the command to lock the site, nothing changes.

gizmo-rt commented 7 years ago

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}

aivus commented 6 years ago

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/

Cypaubr commented 6 years ago

@aivus I don't remember, but not the 3.3 for sure it was older.