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

Nasmed's avatar
Level 17

Problem with hosting Laravel project

Hi guys,

Today, I host my website on FastComet, the first problem I faced is 500 internal server error when trying to access it, I fixed that by changing the PHP version to 7.2 since I'm using Laravel 5.6 it required that.

then I got that error:

Illuminate \ Database \ QueryException
could not find driver (SQL: select count(*) as aggregate from `courses` where `visible` = 1)
/home/lib/library/vendor/laravel/framework/src/Illuminate/Database/Connection.php
     * @param  array     $bindings
     * @param  \Closure  $callback
     * @return mixed
     *
     * @throws \Illuminate\Database\QueryException
     */
    protected function runQueryCallback($query, $bindings, Closure $callback)
    {
        // To execute the statement, we'll simply call the callback, which will actually
        // run the SQL against the PDO connection. Then we can calculate the time it
        // took to execute and log the query SQL, bindings and time in our memory.
        try {
            $result = $callback($query, $bindings);
        }
 
        // If an exception occurs when attempting to run a query, we'll format the error
        // message to include the bindings with SQL, which will make this exception a
        // lot more helpful to the developer instead of just the database's errors.
        catch (Exception $e) {
            throw new QueryException(
                $query, $this->prepareBindings($bindings), $e
            );
        }
 
        return $result;
    }

I talked to the support, he tells me to try PHP 7.1, I did that but the same error occurs.

I can access my hosting server using SSH, so I tried Composer Update, nothing happens I can access MySQL via SSH, works fine.

php -v inputs: ea-php-cli Copyright 2017 cPanel, Inc. PHP 7.2.6 (cli) (built: May 25 2018 07:56:12) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

mysql --version inputs: mysql Ver 14.14 Distrib 5.7.22, for Linux (x86_64) using EditLine wrapper

PHP extensions on the server: http://prntscr.com/jv5p2f

I have searched and try many solutions but nothing...

NOTE: The pages that don't require database connection work.

0 likes
5 replies
jdc1898's avatar

Is is safe to assume your connections are properly configured in your .env or config/database.php file? Was it working and stopped?

Nasmed's avatar
Level 17

@jdc1898 the connections properly configured, it's work locally only, I think the problem comes from the pdo_mysql module, something wrong with the hosting server.

Dhaval_patel's avatar

@nasmed have you installed php7.1-mysqli extension? I am not sure because I am unable to see your screenshot

Nasmed's avatar
Nasmed
OP
Best Answer
Level 17

Problem solved by the host support.

They enabled nd_pdo_mysql and disabled pdo_mysql because both are not possible to be enabled as there is a conflict if both present at the same time.

1 like
Abid667's avatar

Thanks for discussing this issue. I have spent almost 10 days to search for the solution to this problem and at least your guide help me.

1 like

Please or to participate in this conversation.