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

robgoodliffe's avatar

Remote - Class not found. Works on homestead

Everything working fine locally in homestead, but when i push up to forge through envoyer, i get the following error in one part of application:

production.ERROR: exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'Class 'App\Eproduct' not found' in /home/forge/dev.mysite.co.uk/releases/20150821071251/vendor/compiled.php:9843

I can see the file in GIt. There were no deployment errors in envoyer. When i ssh into the site folder, i can see the class. I have completely deleted the site from forge, added it back and redeployed through envoyer and still no luck.

Any suggestions to what it could be would be appreciated.

Thanks

0 likes
7 replies
pmall's avatar

rm vendor/compiled.php then php artisan optimize ?

You seem to have an old compiled.php file.

pmall's avatar

By the way you should update your laravel version. The compiled.php file is not anymore in the vendor folder :

# from laravel core
    /**
     * Get the path to the cached "compiled.php" file.
     *
     * @return string
     */
    public function getCachedCompilePath()
    {
        return $this->basePath().'/bootstrap/cache/compiled.php';
    }

I think this change has been made so it is easier to deploy with zero downtime.

robgoodliffe's avatar

Thanks for the reply. I gave it a go and no luck. I think you're on the right lines though. How do you know that it is an old compiled file?

pmall's avatar

Try to update your laravel version

robgoodliffe's avatar

Thanks for your reply.

I've spent all day updating to a brand new laravel project 5.1; manually transferring the files across so it would be a completely fresh install. I ran all the composer stuff and uploaded it, not before completely deleting the old site from forge and envoyer and recreating it so it would be a fresh deploy, meaning i couldn't possibly have an old version of compiled.php. Again, working perfectly on local and i'm absolutely at a loss. I've tried deleting the compiled.php file and running composer update, but to no avail.

Any more suggestions would be appreciated, as i'm completely out of ideas.

Thanks

Please or to participate in this conversation.