0

I have the following problem when trying to connect to a database in sqlserver that is on a shared server from laravel.

Problem:

Query error from postman.

I am using laravel 8. I would be very grateful if anyone has solved this problem or something similar has happened and can help me.

Note: I have reviewed several forums and tested the sqlsrv driver is correct with tinker.

Review and verify what they tell me in this other stackoverflow link but it does not work for me.

Laravel - SQLSTATE[HY001] Unable to allocate sufficient memory - MsSQL

Susje
  • 101
  • 2

2 Answers2

0

In this case, you need to start the tinker with the following command.

php -d memory_limit=-1 artisan tinker
0

Instead of reading the whole table from the database, considering chunking the result.

https://laravel.com/docs/8.x/eloquent#chunking-results

Flight::chunk(200, function ($flights) {
    foreach ($flights as $flight) {
        //
    }
});
Anurat Chapanond
  • 2,837
  • 3
  • 18
  • 31