Php memory Limit exceeded -- WIKI

Posted on 2011-10-03
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
    LVL 11

    Expert Comment

    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

    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

    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 107

    Assisted Solution

    by:Ray Paseur
    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.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Suggested Solutions

    As this topic comes over and over again in different forms, I've finally decided to write a short (yea, right...) article / tutorial about pagination with PHP with MySQL database. There are dozens of these kind of tutorials, I know - I wanted to mak…
    This is a general how to create your own custom plugin system for your PHP application that you designed (or wish to extend a third party program to have plugin functionality that doesn't have it yet).  This is not how to make plugins for existing s…
    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…
    This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

    737 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

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now