0

I am working on a project using Codeigniter 3 in my XAMPP trying to hit a basic authentication POST API RESTful with Guzzle.

The first time i hit the API it returns status code 500 error without any details regarding what the actual issue is. Hence, based on this thread i caught the error body like this :

$client = new \GuzzleHttp\Client();
$res = $client->request('POST', $url, ['auth' => [$username, $password], 'headers' => ['api_auth_key' => $key], 'http_errors' => false]);
$response = $res->getBody()->getContents();
echo var_dump($response);

but now when i run the above code it returns :

A Database Error Occurred
Error Number: IMSSP/-59
Memory limit of 524288 KB exceeded for buffered query

It seems like the API response size is limited to the already set memory limit because the API supposed to return a lot of data without any filter. A lot of threads like this, this, and etc are basically suggesting to change the ClientBufferMaxKBSize in the php.ini like this:

client_buffer_max_kb_size = '1048576'
sqlsrv.ClientBufferMaxKBSize = 1048576
pdo_sqlsrv.ClientBufferMaxKBSize = 1048576
extension=php_sqlsrv_74_ts_x64.dll
extension=php_pdo_sqlsrv_74_ts_x64.dll

or change it via ini_set like this:

ini_set('memory_limit', '1024M');
ini_set('sqlsrv.ClientBufferMaxKBSize', '1048576'); // Setting to 512M
ini_set('pdo_sqlsrv.client_buffer_max_kb_size', '1048576');

But both code still return the same error message even after restarting the XAMPP. What exactly is the issue and how do i solve it?Is it a problem on the server side or can i fix it on the client side?Please help and thank you.

0 Answers0