n3mesis125 Posted November 5, 2008 Share Posted November 5, 2008 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. Link to comment https://forums.phpfreaks.com/topic/131500-solved-php-throws-500-internal-server-error-page/ Share on other sites More sharing options...
PFMaBiSmAd Posted November 5, 2008 Share Posted November 5, 2008 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); Link to comment https://forums.phpfreaks.com/topic/131500-solved-php-throws-500-internal-server-error-page/#findComment-682954 Share on other sites More sharing options...
n3mesis125 Posted November 5, 2008 Author Share Posted November 5, 2008 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. Link to comment https://forums.phpfreaks.com/topic/131500-solved-php-throws-500-internal-server-error-page/#findComment-682962 Share on other sites More sharing options...
PFMaBiSmAd Posted November 5, 2008 Share Posted November 5, 2008 Check your web server error log file for any php generated errors. Link to comment https://forums.phpfreaks.com/topic/131500-solved-php-throws-500-internal-server-error-page/#findComment-682967 Share on other sites More sharing options...
n3mesis125 Posted November 5, 2008 Author Share Posted November 5, 2008 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. Link to comment https://forums.phpfreaks.com/topic/131500-solved-php-throws-500-internal-server-error-page/#findComment-682970 Share on other sites More sharing options...
revraz Posted November 5, 2008 Share Posted November 5, 2008 Sounds like you need a new host. 20 meg is nothing. Link to comment https://forums.phpfreaks.com/topic/131500-solved-php-throws-500-internal-server-error-page/#findComment-682994 Share on other sites More sharing options...
n3mesis125 Posted November 5, 2008 Author Share Posted November 5, 2008 Yeah tell me about it, royally sucks the big one, gonna need to find another host or host the site myself with a larger memory limit. Link to comment https://forums.phpfreaks.com/topic/131500-solved-php-throws-500-internal-server-error-page/#findComment-683002 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.