Php memory Limit exceeded -- WIKI

Posted on 2011-10-03
Medium Priority
Last Modified: 2012-06-21
Hello ,
  I have MediaWiki install and I get a white page when I tried to upload an image file  > 100 KB. I have change many setting but I get the same error.

I get a White page when I tried to import a file (file size ~ 560 KB).

This is error I get when I tried to do it from the shell

/maintenance # php importImages.php /export/apps/autoscripts/dump
ALERT - script tried to increase memory_limit to 4294967295 bytes which is above the allowed value (attacker 'REMOTE_ADDR not set', file '/export/apps/privatewiki/maintenance/Maintenance.php', line 398)
ALERT - script tried to increase memory_limit to 536870912 bytes which is above the allowed value (attacker 'REMOTE_ADDR not set', file '/export/apps/privatewiki/LocalSettings.php', line 28)
ALERT - script tried to increase memory_limit to 4294967295 bytes which is above the allowed value (attacker 'REMOTE_ADDR not set', file '/export/apps/privatewiki/maintenance/Maintenance.php', line 663)
Import Images

Importing OSV TM high number of errored calls - dat message flow.JPG...done.

Found: 1
Added: 1

here what I have


memory_limit = 512M    

upload_max_filesize = 100M
suhosin.memory_limit = 512

Wiki Setting file
ini_set( 'memory_limit', '512M' );

Question by:SiemensSEN
  • 2
LVL 11

Expert Comment

ID: 36906117
You have something wrong with your script. Its trying to increase memor limit to more than 4GB

4294967295 / 1024 (kb) / 1024 (mb) /1024 (gb) = 3,9 GB

Best Regards

Author Comment

ID: 36906501
Thanks but this is a mediawiki module and  it seems to be setting the memory limit to -1.

ini_set(memory_limit ,-1);

So, I am sure what I need tio do here. Could the suhosin module cause an issue?

Thanks for your help
LVL 11

Accepted Solution

f_o_o_k_y earned 600 total points
ID: 36908012
leave this setting
Wiki Setting file
ini_set( 'memory_limit', '512M' );


try to change
 suhosin.memory_limit = 512
suhosin.memory_limit = 512M

If this does not do a trick than change both memory limits to:
memory_limit = 640M    
suhosin.memory_limit = 640M

Best Regards

Best Regards
LVL 111

Assisted Solution

by:Ray Paseur
Ray Paseur earned 400 total points
ID: 36909190
Who is your hosting provider?  Ask them to remove Suhosin from your server immediately and never put it back on your server, ever.  I have had a couple of run-ins with Suhosin in the past, and they always resulted in some kind of arbitrary, ridiculous injected error in the edge cases.  Suhosin never provided any meaningful security, but it provided plenty of headaches.  Example:  I have a form that works a little like an excel spreadsheet, taking many inputs.  Suhosin assumed this was some kind of attack and silently discarded half of the input.  

You're lucky that you are seeing some of the Suhosin-caused error messages!  It can be very difficult to find all the places where Suhosin can cause damage.

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses
Course of the Month16 days, 23 hours left to enroll

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question