WordPress.org

Ready to get started?Download WordPress

Forums

Where to place a line of code in the htaccess file? (6 posts)

  1. algen
    Member
    Posted 3 years ago #

    Hello,

    I was trying to edit my htaccess file to increase my memory limit. The code that I was trying to add is this:

    php_value memory_limit 64M

    This is my current htaccess file:

    # -FrontPage-
    
    IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*
    
    <Limit GET POST>
    order deny,allow
    deny from all
    allow from all
    </Limit>
    <Limit PUT DELETE>
    order deny,allow
    deny from all
    </Limit>
    AuthName ****************.com
    AuthUserFile /home/*******/public_html/_vti_pvt/service.pwd
    AuthGroupFile /home/*******/public_html/_vti_pvt/service.grp
    
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress

    I tried placing the code under and over the "# END WordPress", but it gave me a 500 error.

    Also tried it it below the "# -FrontPage-", but still gave me an error.

    Sorry if I'm a coding illiterate.

    Thank you,

    Algen

  2. 500 errors mean that you're using a text editor with the wrong encoding, or your host doesn't support bumping the memory via .htaccess.

    Try

    define('WP_MEMORY_LIMIT', '64M');

    at the top of wp-config.php, right after the opening <?php

  3. algen
    Member
    Posted 3 years ago #

    Thanks for the reply @songdogtech. I have tried that.

    Now my memory limit is 96M. But I still have the problem with the WP Super Cache plugin. Even I increase the memory limit to 96M, I still get this error:

    Plugin could not be activated because it triggered a fatal error.
    
    Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 491520 bytes) in /home/******b/public_html/wp-content/plugins/wp-super-cache/wp-cache.php on line 759

    Any suggestions to solve this error?

    Thank you,

    Algen

  4. MickeyRoush
    Member
    Posted 3 years ago #

    If you are on a shared host, an attempt to increase the limit the way you are trying may not work as your host has control of your allotted amount of memory. Try deactivating some other plugins to see if it will work.

    If you're allowed to add/edit a php.ini file by your host. You might be able to try that as well.

  5. algen
    Member
    Posted 3 years ago #

    @MickeyRoush Thank you for the reply mate. No, this is my own new hosting account which can host 50 domains. And this site actually is the first site hosted. I also told my hosting provider to create me a php.ini so that I can also change my memory limit through that file. So that means they allow me to change memory limit allocation.

    Also tried deactivating some plugins to see it that works, but no luck.

    Any suggestion for a solution is much appreciated.

    Thank you,

    Algen

  6. algen
    Member
    Posted 3 years ago #

    Update on the problem..

    Just now, I deactivated 4 plugins, the last one was "Theme Test Drive" plugin, and the "WP Super Cache" just got installed. Any comments on what was the problem, could it be that "Theme Test Drive" and "WP Super Cache" have the conflict? Anyone? I'll try to reactivate the plugins and see what happens.

    Thank you guys,

    Algen

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags