SQL Server 2008 returns “Memory limit of 10240 KB exceeded for buffered query”

前端 未结 3 1232
滥情空心
滥情空心 2021-01-04 06:09

I\'m trying to fill a HTML table with some SQL Server 2008 r2 data, the controller (php_sqlsrv) works fine, the tables are filled very well, but when I try to retrieve a 200

相关标签:
3条回答
  • 2021-01-04 06:28

    add two lines in php.ini

    extension=php_pdo_sqlsrv_55_ts.dll
    extension=php_sqlsrv_55_ts.dll
    client_buffer_max_kb_size = '50240'
    sqlsrv.ClientBufferMaxKBSize = 50240
    
    0 讨论(0)
  • 2021-01-04 06:29

    Change the setting in php.ini.

    Section: sqlsrv

    Directive: sqlsrv.ClientBufferMaxKBSize.

    0 讨论(0)
  • 2021-01-04 06:29

    You can also change the settings during runtime if you do not require production server to have the php.ini changed (Check if this is applicable with your hosting).

    Update the code with following lines:

    ini_set('memory_limit','256M'); // This also needs to be increased in some cases. Can be changed to a higher value as per need)
    ini_set('sqlsrv.ClientBufferMaxKBSize','524288'); // Setting to 512M
    ini_set('pdo_sqlsrv.client_buffer_max_kb_size','524288'); // Setting to 512M - for pdo_sqlsrv
    

    To check if your server supports this, try printing the values after setting the above.

    echo ini_get('memory_limit');
    echo ini_get('sqlsrv.ClientBufferMaxKBSize');
    echo ini_get('pdo_sqlsrv.client_buffer_max_kb_size');
    

    The new values should be the ones we had set in ini_set(). Else, the server does not support runtime configuration changes.

    0 讨论(0)
提交回复
热议问题