Unable to create the storage directory (/home/backoffice/public_html/var/cache/dev/profiler). (500 Internal Server Error)

Symfony Exception

Unable to create the storage directory (/home/backoffice/public_html/var/cache/dev/profiler).

Exception

RuntimeException

  1.             throw new \RuntimeException(sprintf('Please check your configuration. You are trying to use FileStorage with an invalid dsn "%s". The expected format is "file:/path/to/the/storage/folder".'$dsn));
  2.         }
  3.         $this->folder substr($dsn5);
  4.         if (!is_dir($this->folder) && false === @mkdir($this->folder0777true) && !is_dir($this->folder)) {
  5.             throw new \RuntimeException(sprintf('Unable to create the storage directory (%s).'$this->folder));
  6.         }
  7.     }
  8.     /**
  9.      * {@inheritdoc}
  1.         $b->pushHandler(($this->privates['monolog.handler.console'] ?? $this->getMonolog_Handler_ConsoleService()));
  2.         $b->pushHandler(($this->privates['monolog.handler.main'] ?? $this->getMonolog_Handler_MainService()));
  3.         $b->pushHandler($a);
  4.         \Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\AddDebugLogProcessorPass::configureLogger($b);
  5.         $this->services['.container.private.profiler'] = $instance = new \Symfony\Component\HttpKernel\Profiler\Profiler(new \Symfony\Component\HttpKernel\Profiler\FileProfilerStorage(('file:'.$this->targetDir.''.'/profiler')), $btrue);
  6.         $c = ($this->services['kernel'] ?? $this->get('kernel'));
  7.         $d = ($this->services['request_stack'] ?? ($this->services['request_stack'] = new \Symfony\Component\HttpFoundation\RequestStack()));
  8.         $e = new \Symfony\Component\Cache\DataCollector\CacheDataCollector();
  9.         $e->addInstance('cache.app', ($this->services['cache.app'] ?? $this->getCache_AppService()));
  1.      *
  2.      * @return \Symfony\Component\HttpKernel\EventListener\ProfilerListener
  3.      */
  4.     protected function getProfilerListenerService()
  5.     {
  6.         $a = ($this->services['.container.private.profiler'] ?? $this->get_Container_Private_ProfilerService());
  7.         if (isset($this->privates['profiler_listener'])) {
  8.             return $this->privates['profiler_listener'];
  9.         }
  1.         }, => 'onNotification'], -255);
  2.         $instance->addListener('kernel.response', [=> function () {
  3.             return ($this->privates['profiler_listener'] ?? $this->getProfilerListenerService());
  4.         }, => 'onKernelResponse'], -100);
  5.         $instance->addListener('kernel.exception', [=> function () {
  6.             return ($this->privates['profiler_listener'] ?? $this->getProfilerListenerService());
  7.         }, => 'onKernelException'], 0);
  8.         $instance->addListener('kernel.terminate', [=> function () {
  9.             return ($this->privates['profiler_listener'] ?? $this->getProfilerListenerService());
  10.         }, => 'onKernelTerminate'], -1024);
  11.         $instance->addListener('kernel.controller', [=> function () {
  1.         $this->sorted[$eventName] = [];
  2.         foreach ($this->listeners[$eventName] as &$listeners) {
  3.             foreach ($listeners as $k => &$listener) {
  4.                 if (\is_array($listener) && isset($listener[0]) && $listener[0] instanceof \Closure && >= \count($listener)) {
  5.                     $listener[0] = $listener[0]();
  6.                     $listener[1] = $listener[1] ?? '__invoke';
  7.                 }
  8.                 $this->sorted[$eventName][] = $listener;
  9.             }
  10.         }
  1.             if (empty($this->listeners[$eventName])) {
  2.                 return [];
  3.             }
  4.             if (!isset($this->sorted[$eventName])) {
  5.                 $this->sortListeners($eventName);
  6.             }
  7.             return $this->sorted[$eventName];
  8.         }
  1.             $this->orphanedEvents[$this->currentRequestHash][] = $eventName;
  2.             return;
  3.         }
  4.         foreach ($this->dispatcher->getListeners($eventName) as $listener) {
  5.             $priority $this->getListenerPriority($eventName$listener);
  6.             $wrappedListener = new WrappedListener($listener instanceof WrappedListener $listener->getWrappedListener() : $listenernull$this->stopwatch$this);
  7.             $this->wrappedListeners[$eventName][] = $wrappedListener;
  8.             $this->dispatcher->removeListener($eventName$listener);
  9.             $this->dispatcher->addListener($eventName$wrappedListener$priority);
  1.         if (null !== $this->logger && $event instanceof StoppableEventInterface && $event->isPropagationStopped()) {
  2.             $this->logger->debug(sprintf('The "%s" event is already stopped. No listeners have been called.'$eventName));
  3.         }
  4.         $this->preProcess($eventName);
  5.         try {
  6.             $this->beforeDispatch($eventName$event);
  7.             try {
  8.                 $e $this->stopwatch->start($eventName'section');
  9.                 try {
  1.      * @throws \Exception
  2.      */
  3.     private function handleThrowable(\Throwable $eRequest $requestint $type): Response
  4.     {
  5.         $event = new ExceptionEvent($this$request$type$e);
  6.         $this->dispatcher->dispatch($eventKernelEvents::EXCEPTION);
  7.         // a listener might have replaced the exception
  8.         $e $event->getThrowable();
  9.         if (!$event->hasResponse()) {
  1.                 $this->finishRequest($request$type);
  2.                 throw $e;
  3.             }
  4.             return $this->handleThrowable($e$request$type);
  5.         } finally {
  6.             $this->requestStack->pop();
  7.         }
  8.     }
  1.         $this->boot();
  2.         ++$this->requestStackSize;
  3.         $this->resetServices true;
  4.         try {
  5.             return $this->getHttpKernel()->handle($request$type$catch);
  6.         } finally {
  7.             --$this->requestStackSize;
  8.         }
  9.     }
  1.         $this->request $request;
  2.     }
  3.     public function run(): int
  4.     {
  5.         $response $this->kernel->handle($this->request);
  6.         $response->send();
  7.         if ($this->kernel instanceof TerminableInterface) {
  8.             $this->kernel->terminate($this->request$response);
  9.         }
  1. $app $app(...$args);
  2. exit(
  3.     $runtime
  4.         ->getRunner($app)
  5.         ->run()
  6. );
require_once('/home/backoffice/public_html/vendor/autoload_runtime.php') in /home/backoffice/public_html/public/index.php (line 5)
  1. <?php
  2. use App\Kernel;
  3. require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
  4. return function (array $context) {
  5.     return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
  6. };

Stack Trace

RuntimeException
RuntimeException:
Unable to create the storage directory (/home/backoffice/public_html/var/cache/dev/profiler).

  at /home/backoffice/public_html/vendor/symfony/http-kernel/Profiler/FileProfilerStorage.php:43
  at Symfony\Component\HttpKernel\Profiler\FileProfilerStorage->__construct('file:/home/backoffice/public_html/var/cache/dev/profiler')
     (/home/backoffice/public_html/var/cache/dev/ContainerRWVaTR1/App_KernelDevDebugContainer.php:1132)
  at ContainerRWVaTR1\App_KernelDevDebugContainer->get_Container_Private_ProfilerService()
     (/home/backoffice/public_html/var/cache/dev/ContainerRWVaTR1/App_KernelDevDebugContainer.php:5788)
  at ContainerRWVaTR1\App_KernelDevDebugContainer->getProfilerListenerService()
     (/home/backoffice/public_html/var/cache/dev/ContainerRWVaTR1/App_KernelDevDebugContainer.php:2312)
  at ContainerRWVaTR1\App_KernelDevDebugContainer->ContainerRWVaTR1\{closure}()
     (/home/backoffice/public_html/vendor/symfony/event-dispatcher/EventDispatcher.php:245)
  at Symfony\Component\EventDispatcher\EventDispatcher->sortListeners('kernel.exception')
     (/home/backoffice/public_html/vendor/symfony/event-dispatcher/EventDispatcher.php:76)
  at Symfony\Component\EventDispatcher\EventDispatcher->getListeners('kernel.exception')
     (/home/backoffice/public_html/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php:293)
  at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->preProcess('kernel.exception')
     (/home/backoffice/public_html/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php:148)
  at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch(object(ExceptionEvent), 'kernel.exception')
     (/home/backoffice/public_html/vendor/symfony/http-kernel/HttpKernel.php:223)
  at Symfony\Component\HttpKernel\HttpKernel->handleThrowable(object(ErrorException), object(Request), 1)
     (/home/backoffice/public_html/vendor/symfony/http-kernel/HttpKernel.php:86)
  at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
     (/home/backoffice/public_html/vendor/symfony/http-kernel/Kernel.php:202)
  at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
     (/home/backoffice/public_html/vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:35)
  at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run()
     (/home/backoffice/public_html/vendor/autoload_runtime.php:35)
  at require_once('/home/backoffice/public_html/vendor/autoload_runtime.php')
     (/home/backoffice/public_html/public/index.php:5)