shami003
3 months ago
684
13
Laravel

I am getting internal server error after uploading to shared hosting

Posted 3 months ago by shami003

I am getting 500 internal server error after deploying my app to hosting server. Only the main page is working and other pages gives this error. I think there is some issue with AppServiceProvider boot method because I am fetching categories in every page and for home page I fetched it with products.

Here is AppServiceProvider boot method

public function boot()
    {
        $categories = Category::take(10)->latest()->get();
        View::share('categories', $categories);
    }

Some latest logs I have

#18 /home/sham/auction/app/Providers/AppServiceProvider.php(28): Illuminate\Database\Eloquent\Builder->get()
#19 [internal function]: App\Providers\AppServiceProvider->boot()
#20 /home/sham/auction/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(32): call_user_func_array(Array, Array)
#21 /home/sham/auction/vendor/laravel/framework/src/Illuminate/Container/Util.php(36): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#22 /home/sham/auction/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(90): Illuminate\Container\Util::unwrapIfClosure(Object(Closure))
#23 /home/sham/auction/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(34): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure))
#24 /home/sham/auction/vendor/laravel/framework/src/Illuminate/Container/Container.php(590): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL)
#25 /home/sham/auction/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(856): Illuminate\Container\Container->call(Array)
#26 /home/sham/auction/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(839): Illuminate\Foundation\Application->bootProvider(Object(App\Providers\AppServiceProvider))
#27 [internal function]: Illuminate\Foundation\Application->Illuminate\Foundation\{closure}(Object(App\Providers\AppServiceProvider), 20)
#28 /home/sham/auction/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(840): array_walk(Array, Object(Closure))
#29 /home/sham/auction/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/BootProviders.php(17): Illuminate\Foundation\Application->boot()
#30 /home/sham/auction/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(219): Illuminate\Foundation\Bootstrap\BootProviders->bootstrap(Object(Illuminate\Foundation\Application))
#31 /home/sham/auction/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(156): Illuminate\Foundation\Application->bootstrapWith(Array)
#32 /home/sham/auction/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(140): Illuminate\Foundation\Http\Kernel->bootstrap()
#33 /home/sham/auction/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(110): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#34 /home/sham/public_html/index.php(55): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#35 {main}

Please sign in or create an account to participate in this conversation.