Laravel authentication segmentation fault during odbc connect
I use Laravel 7 and pdo and odbc, my database is Vertica DB 9.2 and it's ODBC works fine with isql. In Laravel when I run raw query there is no problem, but when I try to login the "artisan serve" command returns "segmentation fault (core dumped)" and Laravel exits.
Other information:
Ubuntu 16.04, Laravel 7.8, PHP 7.4.5, php7.4-odbc, PDO, Vertica DB 9.2
https://stackoverflow.com/questions/61590017/laravel-authentication-segmentation-fault-during-odbc-connect
0
Answers
Hi, I did a brief test with PDO in a PHP script not using Laravel, but could not reproduce the issue. However, I am using ODBC driver 10.0.0. It's possible that there is an issue in 9.2 that has been fixed, so are you able to obtain the latest driver from the Vertica web site and test with that?
I will also try to setup the complete similar environment with Vertica 10 driver and see if i can reproduce the issue.
Today I check Vertica 10.0.0 and Client Driver (ODBC) 10.0 but I had the problem again!
Any idea?
We will try to replicate with the exact setup and versions, but was there any other log available, such as a stack trace? Does the artisan binary or package offer debug or trace logging?
How did you install php7.4? I created a Ubuntu 16.04 LTS instance on AWS and followed the directions to add a custom repository and was able to replicate the issue.
However, I was able to get it to work by installing the build dependencies (unixODBC, unixODBC-devel, etc.) and build from source as follows:
You'll likely need to remove all of the packaged php7.4 before building from source, and may need to install additional dependencies.
I remove all php packages and install them again, but I had the problem again!
How did you install them: package manager like yum, or from web site, or from compiled source as shown above? You should also check the PATH and other environment variables like LD_LIBRARY_PATH to verify that the expected web server and PHP installation were selected, and that no other PHP binaries or libraries are found in any path.
I use apt-get and install packages in ubuntu terminal
I found the problem in "Laravel forum", but problem is still alive!
It happened because using ORM. For example when you use raw queries such as:
DB::select("SELECT * from users where username = 'user_name' limit 1;");
there is no problem, but when I use eloquent such as:
DB::table('users')->where('username', 'user_name')->select('email')->get();
error occurs.
Thanks Vertica!
Is it true or not that you are utilizing an odbc driver/bundle for Laravel? Without it, Laravel will attempt to perform normal inquiries and utilize an ordinary association with do that. On the off chance that your data set isn't viable with that you could get these abnormal mistakes. You need to utilize an expressive viable driver to make this work. you can also read my blog also about laravel 9.2
You can likewise check the log documents away/logs. Perhaps you can discover some heading in there.