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

Ben94's avatar
Level 1

Maximum execution time of 300 seconds exceeded

I am trying to upload a working Laravel site onto IIS. I believe everything is working correctly as I can see the landing page. But when I try to log in, the request keeps hanging until I get the error 'Maximum execution time of 300 seconds exceeded'.

The Laravel debugger shows the following block of code.

        try {
            return $this->createPdoConnection(
                $dsn, $username, $password, $options <------ This line is red
            );
        } catch (Exception $e) {
            return $this->tryAgainIfCausedByLostConnection(
                $e, $dsn, $username, $password, $options
            );
        }

So I presumed it was a problem with the Database connection, but when I connect to the database (for example by doing a User::All() on the landing page, it works perfectly. Even in artisan tinker the connection is established.

I have narrowed the place where the error establishes down, in the Laravel auth login.

    protected function attemptLogin(Request $request)
    {
        return $this->guard()->attempt(
            $this->credentials($request), $request->filled('remember')
        );
    }

I have no clue what's causing this, but I'm afraid it's an IIS error, although this seems unlikely given that the rest works.

0 likes
1 reply
siangboon's avatar

do you meant User::All() able to return exact all the user from the database? no other information from laravel log?

Please or to participate in this conversation.