Jump to content

[SOLVED] PHP throws 500 Internal Server Error page?


n3mesis125

Recommended Posts

Hey Folks,

 

For some reason it seems that depending on how many foreach() loops I have or possible when too much data is stored in a variable I'm getting a 500 Internal Server Error. The reason I think its too much data is because if I choose a date range to filter data between a specific date, such as one day or 15 days, the page seems to render properly and not give an error. However If I choose a month to filter a month of data, I get a 500 internal server error or a page cannot be displayed. Could this be due to me using a variable (ie: $output) and using $output .= and too much is being stored in it? I'm not sure what is going on.

 

Thanks,

n3m.

You are probably getting a fatal runtime error either due to a memory limit or an execution time limit. Add the following lines immediately after your first opening <?php tag -

 

ini_set("display_errors", "1");
error_reporting(E_ALL);

I tried putting what you suggested but a 'Page Cannot be displayed' shows up and the php script isn't outputted? Just to add, I'm with a shared web hosting provider and I was told I have a 20 mb Ram limit, I don't believe this report I'm displaying would use that much memory to run.

Would any other pages that throw a ton of Division by zero errors chew up a lot of RAM and affect any other pages that try to load data?

 

Edited Note:

I actually just ran a memory_get_usage() and figured on a 5 day run of data its about 2.6mb (2678464  bytes) so I multiplied that by 6 for about 30 days in a month, and I get close to 15.6mb, so I guess maybe it is getting close to the 20mb cap the hosting provider has, which sucks :S That doesn't even take into account any other reports people may be running on my server at the same time. If 2 ppl are running this report simultaneously it more than likely bogs even more.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.