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

kamr's avatar
Level 1

PHP Fatal Error: Class not found

PHP Fatal error: Uncaught Error: Class 'Illuminate\Foundation\Console\Kernel' not found in /var/www/vhosts/gate.rrpo.uz/httpdocs/app/Console/Kernel.php:9 Stack trace: #0 {main} thrown in /var/www/vhosts/gate.rrpo.uz/httpdocs/app/Console/Kernel.php on line 9

This is my app/Console/Kernel.php

<?php

namespace App\Console;

use App\Models\Product;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;

class Kernel extends ConsoleKernel
{
    /**
     * The Artisan commands provided by your application.
     *
     * @var array
     */
    protected $commands = [
        //
    ];

    /**
     * Define the application's command schedule.
     *
     * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
     * @return void
     */
    protected function schedule(Schedule $schedule)
    {
        $schedule->call(function(){
            Product::send();
        })->daily();
    }

    /**
     * Register the commands for the application.
     *
     * @return void
     */
    protected function commands()
    {
        $this->load(__DIR__.'/Commands');

        require base_path('routes/console.php');
    }
}
0 likes
10 replies
Sinnbeck's avatar

Try reinstalling with composer

composer install
kamr's avatar
Level 1

@Sinnbeck How to run it in hosting? (I mean in local, I can just do composer install in terminal, what about hosting, where there is no terminal?)

Sinnbeck's avatar

@kamr Ask your provider. Did you just upload the files using FTP? If so, did you upload the vendor directory as well?

Sinnbeck's avatar

@kamr When do you get this error? I assume its when you run the scheduler? Or?

kamr's avatar
Level 1

@Sinnbeck yep, when i try to run scheduler in hosting, locally it runs well

kamr's avatar
Level 1

@Sinnbeck By reading your question I understood how to solve my problem) ahaha, thanks)

Sinnbeck's avatar

@kamr Good to hear :) If others find this thread later, it might be nice to just write a word or two on how you soved it :)

kamr's avatar
Level 1

@Sinnbeck I did it in web provider's settings, just configured so it would make request to specific route in my app, instead of running scheduler in laravel. in web provider, you can configure scheduling tasks, by various methods, but I don't know why running a specific file (kernel.php) didn't work

Please or to participate in this conversation.