skip to Main Content

I am unable to upload a new theme in wordpress.The maximum limit showing right now is 10 mb. What changes should I make in CPanel. I have created a new file in Public_html named php.ini.
and pasted these lines.

upload_max_filesize = 256MB
post_max_size = 32M
memory_limit =  32M
max_execution_time = 300

3

Answers


  1. 1: Theme Functions File

    There are cases where we have seen that just by adding the following code in theme’s functions.php file, you can increase the upload size:

    @ini_set( 'upload_max_size' , '64M' );
    @ini_set( 'post_max_size', '64M');
    @ini_set( 'max_execution_time', '300' );
    

    2. Create or Edit an existing PHP.INI file

    For this method you will need to access your WordPress site’s root folder by using FTP or File Manager app in your hosting account’s cPanel dashboard.

    In most cases if you are on a shared host, then you will not see a php.ini file in your directory. If you do not see one, then create a file called php.ini and upload it in the root folder. In that file add the following code:

    upload_max_filesize = 64M
    post_max_size = 64M
    max_execution_time = 300
    

    This method is reported to work for many users. Remember if 64 doesn’t work, then try 10MB (sometimes that work).

    3. htaccess Method

    Some people have tried using the .htaccess method where by modifying the .htaccess file in the root directory, you can increase the maximum upload size in WordPress. Edit the .htaccess file in your WordPress site’s root folder and add the following code:

    php_value upload_max_filesize 64M
    php_value post_max_size 64M
    php_value max_execution_time 300
    php_value max_input_time 300
    
    Login or Signup to reply.
  2. Using .htaccess file in wordpress. You can define below lines,

    Open it .htaccess in folder and added the following into a newline at the end of the file.

    php_value memory_limit 256
    php_value upload_max_filesize 64M
    php_value post_max_size 64M
    php_value max_execution_time 300
    php_value max_input_time 1000

    Save your changes and overwrite the .htaccess file.

    Get More info, you can follow the link,
    For upload file size: https://www.bitcatcha.com/blog/increase-maximum-upload-file-size-in-wordpress/

    For Increase Memory Limit size :https://premium.wpmudev.org/blog/increase-memory-limit/

    Login or Signup to reply.
  3. you can create php.ini file in wp_admin folder in root wordpress directory

     open php.ini and override  these values 
          1- upload max size 
          2- post max size 
          3- max execution time
      now php.ini file looks like that 
             upload_max_filesize = 128M
             post_max_size = 128M
             max_execution_time = 180
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search