Questions & Answers

SQLSTATE[HY000]: General error: 1436 Thread stack overrun on Shared Hosting

Hi I'm using this Laravel Package

This is my code:

$RelatedProducts = Product::where('product_status', 1)

Its working fine on my Local Machine (XAMPP-Windows) but not on my Linux Shared Hosting

When I'm searching for something big it returning this error:

I think I have to change the SQL config file, but on shared hosting they won't allow it, is there any other way to do this?

SQLSTATE[HY000]: General error: 1436 Thread stack overrun: 230160 bytes used of a 262144 byte stack, and 32000 bytes needed.
Answers(1) :


You should raise the thread_stack to 512k, which is usually enough to avoid this problem permanently.

  1. Backup and Edit my.cnf, locate thread_stack directive and modify to 512k

  2. Restart MySQL service to reload new configuration

  3. Run your PHP script or test again

for more information : Mysql bug report