Activity Stream
48,167 MEMBERS
6876 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 7 of 7
  1.     
    #1
    Member

    Default Fixing "Fatal Error: Allowed memory size of xxxxxxxx bytes exhausted..."

    Error: (Just an example. File name, memory size, etc. can vary)

    Code: 
    Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 71 bytes) in /home/xxxxxxxx/public_html/search.php on line 1155
    How to fix it:

    1. On a shared server
    Open your .htaccess file and enter this line into it
    Code: 
    php_value memory_limit 32M
    Contact Your Host If This Doesn't Work

    2. On a VPS/Dedicated server

    First step for this is to locate your php.ini file in the server and to see what is the memory limit (this is shown in the error message). Create a file with the below code and name it something like ?test.php?

    Code: 
    <?php phpinfo(); ?>
    Upload this file to your site root and point your browser to this file, now it will show the phpinfo of the server, in this you will find ?Configuration File (php.ini) Path: /usr/local/lib/php.ini?, this is your php.ini location. You can find the memory limit also in this page ?memory_limit: 32M?

    Then you can use putty, SSH client, login to putty and locate the file php.ini and edit the memory limit.



    Code: 
    Log in as root.
    Type the following and hit enter: vi /usr/local/lib/php.ini
    Now that you?re in vi, hit escape a few times then type the following
    and hit enter: /memory_limit
    That basically does a ?find? in the file you?re editing.
    Press the ?i? key. This puts you in ?insert? mode, which basically
    allows you to edit things.
    Change the current setting (probably 32M) to 64M (or whatever you want).
    Press escape, then type :wq and hit enter. That says ?save the file
    and quit.?
    After this restart your Apache for the changes to effect. You can do this through WHM.
    If you dont have WHM installed then use this command
    Code: 
    /etc/rc.d/init.d/httpd restart
    iFlames Reviewed by iFlames on . Fixing "Fatal Error: Allowed memory size of xxxxxxxx bytes exhausted..." Error: (Just an example. File name, memory size, etc. can vary) Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 71 bytes) in /home/xxxxxxxx/public_html/search.php on line 1155 How to fix it: 1. On a shared server Open your .htaccess file and enter this line into it php_value memory_limit 32M Rating: 5

  2.   Sponsored Links

  3.     
    #2
    Pure Awesomeness!
    Nice tutorial m8, here is another solution if u use wordpress

    Add this line of code in your Wordpress WP-CONFIG.PHP file. Add it before any other values. (My preferred choice)
    Code: 
    define('WP_MEMORY_LIMIT', '64M');
    Try to increase it to 64M if 32M seems to be insufficient. These solutions can also be applied to other PHP-based programs and not justWordpress.

    Source: Bloggista



  4.     
    #3
    Member
    thanks RT

  5.     
    #4
    Member
    Nice, Thanks

  6.     
    #5
    Member
    Website's:
    hostreal.net
    Nice guide, will keep this guide to give to other new vps users.

  7.     
    #6
    Member
    Website's:
    CodeSociety.net
    no this is a stupid fix! This does not fix the problem and only masks it briefly. SOMETIMES this is necessary but you should find out why your scripts are requiring that much memory to run.



  8.     
    #7
    Member
    Quote Originally Posted by immortalxx View Post
    no this is a stupid fix! This does not fix the problem and only masks it briefly. SOMETIMES this is necessary but you should find out why your scripts are requiring that much memory to run.
    if you have an alternative way to fix this then post it here
    no point talking shit here mate..

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 4
    Last Post: 3rd Jan 2012, 04:06 PM
  2. Replies: 6
    Last Post: 6th Jul 2011, 11:40 PM
  3. RL - FS download plugin Memory Fatal Error Help
    By zyberakuma in forum Technical Help Desk Support
    Replies: 2
    Last Post: 4th Dec 2010, 09:43 PM
  4. Pre-orders open for "infinite" usb memory drive
    By The Viper in forum News & Current Events
    Replies: 7
    Last Post: 3rd Aug 2010, 04:40 PM
  5. Help!! Fatal error: Out of memory?
    By rdeguz5 in forum Technical Help Desk Support
    Replies: 8
    Last Post: 21st Jun 2010, 04:36 AM

Tags for this Thread

BE SOCIAL