Changing PHP Memory Limit via .htaccess

Changing PHP Memory Limit via .htaccess

If you get an error such as:



Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 317560 bytes)



On your PHP scripts, you can fix it with a line in your .htaccess reading:



php_value memory_limit 12M



Simply modify the 12M to the desired amount of PHP memory.
    • Related Articles

    • How to get your own PHP error log via .htaccess

      I would like to get my own PHP error log, how can I do this? =========================================== If you don't have a .htaccess file, create it it using the file manager or a regular text editor on your computer and upload that file using ftp. ...
    • .htaccess

      .htaccess     Example of URI Redirects in a WP Site: [root@ca-web1 aiglebleu.org]# cat .htaccess # Redirects <IfModule mod_rewrite.c> RewriteCond %{REQUEST_URI} (entag/)(.*) RewriteRule ^(.*)entag/(.*)$ http://www.aiglebleu.org/en/$2 [NC,L] ...
    • Common .htaccess Redirects

      #301 Redirects for .htaccess #Redirect a single page: Redirect 301 /pagename.php http://www.domain.com/pagename.html #Redirect an entire site: Redirect 301 / http://www.domain.com/ #Redirect an entire site to a sub folder Redirect 301 / ...
    • Common .htaccess Redirects

      #301 Redirects for .htaccess #Redirect a single page: Redirect 301 /pagename.php http://www.domain.com/pagename.html #Redirect an entire site: Redirect 301 / http://www.domain.com/ #Redirect an entire site to a sub folder Redirect 301 / ...
    • Increasing Upload Size/Time in PHP Applications

      1) Create a .htaccess file in the root folder of the web server. 2) Put the following code in side the .htaccess file and save it. php_value upload_max_filesize 50M php_value post_max_size 50M php_value max_execution_time 200 php_value max_input_time ...