Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

abbood's avatar

Uncaught ReflectionException: Class hash does not exist in envoyer deploy

I'm deploying using envoyer as usual. The one caveat is that during my local host development (and while i was switching git branches).. I faced this error:

[ReflectionException] Class App\Http\Controllers\Admin\BatchUpdateStoresController does not exist

I solved it by clearing the routes cache (see details in this stackoverflow question/answer).

The problem now is that when I deployed on envoyer.. I'm getting this error on the nginx logs:

PHP message: PHP Fatal error:  Uncaught ReflectionException: Class hash does not exist in /home/forge/default/envoyer/releases/20180306221058/bootstrap/cache/compiled.php:1479
Stack trace:
#0 /home/forge/default/envoyer/releases/20180306221058/bootstrap/cache/compiled.php(1479): ReflectionClass->__construct('hash')
#1 /home/forge/default/envoyer/releases/20180306221058/bootstrap/cache/compiled.php(1433): Illuminate\Container\Container->build('hash', Array)
#2 /home/forge/default/envoyer/releases/20180306221058/bootstrap/cache/compiled.php(2011): Illuminate\Container\Container->make('hash', Array)
#3 /home/forge/default/envoyer/releases/20180306221058/bootstrap/cache/compiled.php(1686): Illuminate\Foundation\Application->make('hash')
#4 /home/forge/default/envoyer/releases/20180306221058/bootstrap/cache/compiled.php(524): Illuminate\Container\Container->offsetGet('hash')
#5 /home/forge/default/envoyer/releases/20180306221058/bootstrap/

I tried deleting the /home/forge/default/envoyer/releases/20180306221058/bootstrap folder all together.. but that made it only worse (ie i wasn't even getting nginx error logs anymore).

what do I do?

0 likes
1 reply
ejdelmonico's avatar

@abbood I would redeploy if you think things got messed up. Try clearing caches after the deploy. SSH into the release directory and run: php artisan clear-compiled. There are other commands which clear caches. If you decide to clear those just make sure you run the caching commands as well so that you don't suffer performance issues. That is probably a good place to start.

Please or to participate in this conversation.