skip to Main Content

How to increase maximum upload file size in WordPress using .htaccess?

Been trying to increase the max upload file size in WordPress. Tried changing php in cPanel but couldn’t get that to work.
Tried typing this code into the .htaccess editor plugin:

php_value upload_max_filesize 128M
php_value post_max_size 128M
php_value memory_limit 256M
php_value max_execution_time 300
php_value max_input_time 300

but it keeps telling me syntax error. I’m placing it after the #END WordPress line too.

2

Answers


  1. You can also use ini_set in wp_config.php

    ini_set('upload_max_filesize', '128M');
    ini_set(' post_max_size', '128M');
    
    Login or Signup to reply.
  2. .htaccess
    php_value upload_max_filesize 64M
    php_value post_max_size 128M
    php_value memory_limit 256M
    php_value max_execution_time 300
    php_value max_input_time 300
    
    Functions.php
    @ini_set( 'upload_max_size' , '64M' );
    @ini_set( 'post_max_size', '64M');
    @ini_set( 'max_execution_time', '300' );
    
    php.ini put on root directory where your .htaccess located
    upload_max_filesize = 25M
    post_max_size = 13M
    memory_limit = 15M
    
    wp-config.php
    @ini_set( 'upload_max_size' , '20M' );
    @ini_set( 'post_max_size', '13M');
    @ini_set( 'memory_limit', '15M' );
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search