Ellis Mangune
Ellis Mangune

Reputation: 11

Illuminate\Database\Query Exception - Could Not Find Driver

enter image description here

After transferring our application to the server. The application loaded accordingly. When we tried to login to the app, we received this kind of error. PHP version is 8.2.11 and Laravel 10.29.0. Is there something that we missed during the transfer of the application?

Here is the Code Structure:

namespace App\Http\Middleware;



use App\Providers\RouteServiceProvider;

use Closure;

use Illuminate\Http\Request;

use Illuminate\Support\Facades\Auth;

use Symfony\Component\HttpFoundation\Response;



class RedirectIfAuthenticated

{

    /**

     * Handle an incoming request.

     *

     * @param  \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response)  $next

     */

    public function handle(Request $request, Closure $next, string ...$guards): Response

    {

        $guards = empty($guards) ? [null] : $guards;



        foreach ($guards as $guard) {

            if (Auth::guard($guard)->check()) {

                return redirect(RouteServiceProvider::HOME);

            }

        }



        return $next($request);

    }

}

Thank you for any assistance you can offer.

Upvotes: 0

Views: 60

Answers (1)

Umer Fayyaz
Umer Fayyaz

Reputation: 497

You didn't enable PDO extension . In your cpanel select

SOFTWARE > Select PHP Version

You see all extensions there , enable these extensions :

pdo ,mysqlnd , ndmysqli , nd_pdo_mysql

Upvotes: 1

Related Questions