belateh Posted May 10, 2011 Share Posted May 10, 2011 Hello everyone, I have some problem so can you help me to solv this? i get this error message: Out of memory (Needed 8388572 bytes) File: C:\Sites\Single9\xxx\webroot\Sources\Display.php line: 712 Link to comment https://forums.phpfreaks.com/topic/236019-displayphp-out-of-memory/ Share on other sites More sharing options...
AbraCadaver Posted May 10, 2011 Share Posted May 10, 2011 How about some code? Link to comment https://forums.phpfreaks.com/topic/236019-displayphp-out-of-memory/#findComment-1213376 Share on other sites More sharing options...
belateh Posted May 10, 2011 Author Share Posted May 10, 2011 this is where i get the problem i think, 692: p.question, p.voting_locked, p.hide_results, p.expire_time, p.max_votes, p.change_vote, 693: p.guest_vote, p.id_member, IFNULL(mem.real_name, p.poster_name) AS poster_name 694: FROM {db_prefix}polls AS p 695: LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = p.id_member) 696: WHERE p.id_poll = {int:id_poll} 697: LIMIT 1', 698: array( 699: 'id_poll' => $topicinfo['id_poll'], 700: ) 701: ); 702: $pollinfo = $smcFunc['db_fetch_assoc']($request); 703: $smcFunc['db_free_result']($request); 704: 705: $request = $smcFunc['db_query']('', ' 706: SELECT COUNT(DISTINCT id_member) AS total 707: FROM {db_prefix}log_polls 708: WHERE id_poll = {int:id_poll}', 709: array( 710: 'id_poll' => $topicinfo['id_poll'], 711: ) ==>712: ); 713: list ($pollinfo['total']) = $smcFunc['db_fetch_row']($request); 714: $smcFunc['db_free_result']($request); 715: 716: // Get all the options, and calculate the total votes. 717: $request = $smcFunc['db_query']('', ' 718: SELECT pc.id_choice, pc.label, pc.votes, IFNULL(lp.id_choice, -1) AS voted_this 719: FROM {db_prefix}poll_choices AS pc 720: LEFT JOIN {db_prefix}log_polls AS lp ON (lp.id_choice = pc.id_choice AND lp.id_poll = {int:id_poll} AND lp.id_member = {int:current_member}) 721: WHERE pc.id_poll = {int:id_poll}', 722: array( 723: 'current_member' => $user_info['id'], 724: 'id_poll' => $topicinfo['id_poll'], 725: ) 726: ); 727: $pollOptions = array(); 728: $realtotal = 0; 729: $pollinfo['has_voted'] = false; 730: while ($row = $smcFunc['db_fetch_assoc']($request)) 731: { 732: censorText($row['label']); Link to comment https://forums.phpfreaks.com/topic/236019-displayphp-out-of-memory/#findComment-1213380 Share on other sites More sharing options...
belateh Posted May 10, 2011 Author Share Posted May 10, 2011 here is whole display.php [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/236019-displayphp-out-of-memory/#findComment-1213384 Share on other sites More sharing options...
belateh Posted May 10, 2011 Author Share Posted May 10, 2011 How about some code? can you help me AbraCadaver? Link to comment https://forums.phpfreaks.com/topic/236019-displayphp-out-of-memory/#findComment-1213396 Share on other sites More sharing options...
Tonic-_- Posted May 10, 2011 Share Posted May 10, 2011 Try going into your php.ini file (PHP configuration) and find the line memory_limit and try to raise it to maybe 15M or something? Something a bit higher then whatever the default value may be. I noticed this is a SMF related file so it's safe to assume that this is just a PHP configuration thing that needs to be bumped up a bit more. Link to comment https://forums.phpfreaks.com/topic/236019-displayphp-out-of-memory/#findComment-1213400 Share on other sites More sharing options...
belateh Posted May 11, 2011 Author Share Posted May 11, 2011 I can't find the php.ini file, what to do now? Link to comment https://forums.phpfreaks.com/topic/236019-displayphp-out-of-memory/#findComment-1213632 Share on other sites More sharing options...
gizmola Posted May 11, 2011 Share Posted May 11, 2011 make a simple script that has: Navigate to this page, and look at the output, It will tell you the settings you have as well as the location of configuration files, extenstions loaded, etc. etc. Link to comment https://forums.phpfreaks.com/topic/236019-displayphp-out-of-memory/#findComment-1213638 Share on other sites More sharing options...
belateh Posted May 11, 2011 Author Share Posted May 11, 2011 Thnks Link to comment https://forums.phpfreaks.com/topic/236019-displayphp-out-of-memory/#findComment-1213646 Share on other sites More sharing options...
belateh Posted May 11, 2011 Author Share Posted May 11, 2011 I done thatand now i am wondering how can i change the memory limit in the configuration? Link to comment https://forums.phpfreaks.com/topic/236019-displayphp-out-of-memory/#findComment-1213677 Share on other sites More sharing options...
gizmola Posted May 11, 2011 Share Posted May 11, 2011 You need to reference the ini file, open it with a text editor, find the line memory_limit = And increase that. You got an out of memory limit at only 8 mb, so the limit must be unusually low. Try bumping it up to 32m. Whenever you make changes to the ini file, you need to restart apache, and you should probably check the phpinfo to be sure that your change is reflected in the configuration screen. Link to comment https://forums.phpfreaks.com/topic/236019-displayphp-out-of-memory/#findComment-1213678 Share on other sites More sharing options...
belateh Posted May 11, 2011 Author Share Posted May 11, 2011 Thank you very much the problem is solved Link to comment https://forums.phpfreaks.com/topic/236019-displayphp-out-of-memory/#findComment-1213680 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.