Paul Sola-Eniolawun
Paul Sola-Eniolawun

Reputation: 1

PHP - Laravel error : Symfony\Component\Finder\Exception\DirectoryNotFoundExceptionon my cPanel

I mistakenly ran my laravel application on debug mode in my production environment, and it threw an error for me to change App_debug:true to App_debug:false, which I did, ever since then, my site has been throwing an HTTP ERROR 500

"This page isn’t working admin.robyhub.com is currently unable to handle this request. HTTP ERROR 500"

I then went on to my cpanel terminal and tried to clear the logs on the config file but it gives me the below error.

[thehcerl@premium261 admin.robyhub.com]$ php artisan config:clear

   Symfony\Component\Finder\Exception\DirectoryNotFoundException

  The "/home/thehcerl/admin.robyhub.com/resources/lang/ha" directory does not exist.

  at vendor/symfony/finder/Finder.php:590
    586▕             } elseif ($glob = glob($dir, (\defined('GLOB_BRACE') ? \GLOB_BRACE : 0) | \GLOB_ONLYDIR | \GLOB_NOSORT)) {
    587▕                 sort($glob);
    588▕                 $resolvedDirs = array_merge($resolvedDirs, array_map([$this, 'normalizeDir'], $glob));
    589▕             } else {
  ➜ 590▕                 throw new DirectoryNotFoundException(sprintf('The "%s" directory does not exist.', $dir));
    591▕             }
    592▕         }
    593▕
    594▕         $this->dirs = array_merge($this->dirs, $resolvedDirs);

      +2 vendor frames
  3   app/Providers/TranslationServiceProvider.php:40
      Illuminate\Support\Facades\Facade::__callStatic()

  4   app/Providers/TranslationServiceProvider.php:27
      App\Providers\TranslationServiceProvider::phpTranslations()

Cpanel Terminal

Ever since I changed debug to false on my .env from my laravel project main directory because the laravel documentation warned me to not use debug mode on a non-local environment. I expected my application would automatically stop receiving the laravel debug config solutions and would run properly.

Upvotes: 0

Views: 1366

Answers (1)

Paul Sola-Eniolawun
Paul Sola-Eniolawun

Reputation: 1

This is not a very generic error, it's as a result of an error on my part, I created language folders that I did not link to my PHP "translationProvider.php" file, so it invariably gave me that issue. I was using a purchased template from Envato so I hadn't taken the time to get the full inner working of the backend at the time.

If anyone has a similar error I hope this will guide you not to make the mistakes I made, and meticulously look through your code when making changed or edits.

Thanks, happy coding.

Upvotes: 0

Related Questions