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

MGanjKhani's avatar

Laravel 7 Segmentation fault (core dumped) when try to login

I use laravel 7 and HP Vertica as a database. I connect to DB with odbc. when I use raw query such as "select" it works fine, but when I try to login "Segmentation fault (core dumped)" occurs. Any idea?

0 likes
27 replies
bobbybouwmann's avatar

Are you using an odbc driver/package for Laravel? Without it, Laravel will try to perform regular queries and use a regular connection to do that. If your database is not compatible with that you might get these weird errors. You have to use an eloquent compatible driver to make this work.

You can also check the log files in storage/logs. Maybe you can find some direction in htere.

1 like
MGanjKhani's avatar

@bobbybouwmann @sinnbeck thaks for your rsponse But nothing happened and the problem is still alive!

@bobbybouwmann I check storage/logs but there was no log about my problem. @sinnbeck I do all of the instruction commands and install DBAL Vertica driver but I get segmentation fault again.

MGanjKhani's avatar

@sinnbeck I check again and get this error:

InvalidArgumentException Unsupported driver [vertica].

bobbybouwmann's avatar

So, the vertica driver is not installed correctly.

Did you update your AppServicePorvider with the correct content?

Sinnbeck's avatar

Did you install it?

composer require mixartemev/dbal-vertica-driver
MGanjKhani's avatar
public function boot()
    {
        App::bind('db.connector.vertica', function () {
            return new VerticaDriver;
        });
        DB::resolverFor('vertica', function ($connection, $database, $prefix, $config) {
            return new PostgresConnection($connection, $database, $prefix, $config);
        });
    }
MGanjKhani's avatar
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Using version ^1.3 for mixartemev/dbal-vertica-driver
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files
10 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
jlrdw's avatar

PostgresConnection connection there, is that correct? Also please format your code like:

<?php
class AppServiceProvider extends ServiceProvider
{
    public function boot()
    {
        App::bind('db.connector.vertica', function () {
            return new VerticaDriver;
        });
        DB::resolverFor('vertica', function ($connection, $database, $prefix, $config) {
            return new VerticaConnection($connection, $database, $prefix, $config);
        });
    }
}

That's formatted, github markdown. Above is hard to read.

MGanjKhani's avatar

Now I have new error in terminal:

InvalidArgumentException
  Unsupported driver [vertica].

  at vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectionFactory.php:287
    283|             case 'sqlsrv':
    284|                 return new SqlServerConnection($connection, $database, $prefix, $config);
    285|         }
    286|
  > 287|         throw new InvalidArgumentException("Unsupported driver [{$driver}].");
    288|     }
    289| }
    290|

+6 vendor frames
  7   app/Providers/AppServiceProvider.php:32
      Illuminate\Support\Facades\Facade::__callStatic()

      +8 vendor frames
  16  [internal]:0
      Illuminate\Foundation\Application::Illuminate\Foundation\{closure}()

   Whoops\Exception\ErrorException

  Module 'odbc' already loaded

  at Unknown:0
    1|

      +1 vendor frames
  2   [internal]:0
      Whoops\Run::handleShutdown()
laracoft's avatar

@mganjkhani better to understand the code we are sharing before pasting them into your project. Your new error is because you do not have a vertica entry in your config/database.php.

Please try and format your posts neatly with markdown otherwise it is very hard to read and help.

1 like
MGanjKhani's avatar

OK, I checked, this is config/database.php:

 'connections' => [
        'vertica' => [
            'driver' => 'vertica',
            'host' => env('DB_HOST_VERTICA', '127.0.0.1'),
            'port' => env('DB_PORT_VERTICA', 5433), //EXACTLY DIGITS, NOT STRING
            'database' => env('DB_DATABASE_VERTICA', 'forge'),
            'username' => env('DB_USERNAME_VERTICA', 'forge'),
            'password' => env('DB_PASSWORD_VERTICA', ''),
            'schema' => 'public',
            'sslmode' => 'allow',
            'options' => [
                PDO::ATTR_EMULATE_PREPARES => false,
            ]
        ],
laracoft's avatar

Try clearing your config cache, php artisan config:clear and see if you still get the Unsupported driver [vertica] exception.

MGanjKhani's avatar

I do that, yes I still get this:

Unsupported driver [vertica] exception.
jlrdw's avatar

Are you sure your boot method is correct.

MGanjKhani's avatar

Yes, after adding these lines I get that error:

public function boot()
    {
        App::bind('db.connector.vertica', function () {
            return new VerticaDriver;
        });
        DB::resolverFor('vertica', function ($connection, $database, $prefix, $config) {
            return new VerticaConnection($connection, $database, $prefix, $config);
        });
    }
MGanjKhani's avatar

When I run:

composer require mixartemev/dbal-vertica-driver

Terminal shows:

Using version ^1.3 for mixartemev/dbal-vertica-driver
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Package phpunit/php-token-stream is abandoned, you should avoid using it. No replacement was suggested.
Generating optimized autoload files

Does it help to solve my problem?

laracoft's avatar

The composer required the package and completed with no errors. Have you tried running your code again?

MGanjKhani's avatar

Thanks a lot, I hope that we can solve this problem.

MGanjKhani's avatar
MGanjKhani
OP
Best Answer
Level 1

Thanks GOD! I found the solution:

in app/Providers/AppServiceProvider.php we should add this line:

use Doctrine\DBAL\Driver\Vertica\VerticaDriver;
2 likes
bobbybouwmann's avatar

@mganjkhani You could have found this problem if you did look in your storage/logs directory. The error should have been there, 100% sure.

MGanjKhani's avatar

This error happens in Laravel ORM not in PHP pure. I use ODBC driver 10.0.1 with no problem.

Please or to participate in this conversation.