PHP Memory Limits for an App

Avatar
  • Answered
I'm concerned about PHP memory limits. I'm working on a excel export utility for my website (by PHPExcel), but server returned a memory overflow error message. I tried adjusting the memory limit by ini_set command, and after several attemps, I ended using a 1024MB requirement for a succesful output, and it was a limited report (about 3k registers). I'm still concerned when lrager reports might be needed. What would be the maximum memory allowed for me to borrow while running my scripts?
Avatar
IMH Support Agent 5
Hello, Thank you for contacting us about PHP memory limits. There is no set limit as far as I know, but if you max out the memory too far you may run into other data transfer limits either in your PHP configuration or other services. Typically, it is not recommended to increase the memory limit too high because you would not want too many resources being drained into one script. It would be better to find some way in your coding to leverage those processes. This is particularly important in a shared hosting environment because of resource abuse monitoring. However, if you are in a VPS/Dedicated hosting environment you can always submit a ticket for a server review. Best, Christopher M.