Upload_max_filesize directive in php ini cpanel

I am using VPS hosting in that i have CPanel login details ,i was installed wordpress and i am trying import some posts that i have exported from last website.But i am getting the error like Max_file_Upload_size is more than 2M.How can i change the max file upload size . I was try to add php.ini file to my root folder but i didn't get any change and aslo add php.ini into wp-admin folder also,but i didn't able to import the files.In my Cpanel i didn't find any php.ini files.i am trying in google also but i didn't get answer for me help me....

asked Jan 9, 2014 at 5:18

8

You should just try adding this to the 2nd line of your wp-config.php file.

This line handles your upload max filesize size *and* your php memory.

// this will change your max file size upload AND your php memory
define( 'WP_MEMORY_LIMIT', '64M' );

More info can be seen here regarding this code from the WP Codex (2/3 down the page):

WP Memory Limit - WP Codex

answered Jan 15, 2014 at 14:22

Upload_max_filesize directive in php ini cpanel

DLaverickDLaverick

6355 silver badges16 bronze badges

1

Add below line on the top of wordpress main index.php :

ini_set('max_file_uploads', 100);

Upload_max_filesize directive in php ini cpanel

urfusion

5,3745 gold badges46 silver badges82 bronze badges

answered Jan 9, 2014 at 5:25

Anil RAnil R

2911 silver badge6 bronze badges

7

The default upload file size for WordPress is 2 MB, which is a problem if you want to upload a large media files. If you get this error, “The uploaded file exceeds the upload_max_filesize directive in php.ini”, follow these steps:

  1. Locate the php.ini file inside the wp-admin directory (if you can’t find this file see notes below)
  2. Find this line in the php.ini file “upload_max_filesize = 2M” and replace it with a higher value (e.g. “upload_max_filesize = 64M”)
  3. You may also want to increase your max post size. Look for this line in your php.ini file “post_max_size” and increase it as well.
  4. Save the changes to the file inside your wp-admin directory.
  5. Try the upload again
  6. If you still have issues, look for this file in your root directory and make the same changes.

If you don’t have a php.ini file in your directory, you can usually generate one from the control panels of your host.

You can download php.ini file from here.

Alternate way using

htaccess

Add this code in htaccess:

php_value upload_max_filesize 20M
php_value post_max_size 20M
php_value max_execution_time 200
php_value max_input_time 200

You can increase the file upload limit according to your requirement.

answered Jan 9, 2014 at 5:28

Mahmood RehmanMahmood Rehman

4,2957 gold badges37 silver badges74 bronze badges

7

As you say, you only have access to cpanel, then go to "file manager" in cpanel and then follow Mahmood Rehman's steps.

You can also configure a FTP account and use ftp app like filezilla for downloading and uploading files direclty to the server, and also to edit php.ini and other files.

answered Jan 9, 2014 at 5:40

Another solution is to point the .htaccess to your custom PHP ini file:

# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress


suPHP_ConfigPath /public_html/php.ini

and the write your php.ini files

upload_max_filesize = 64M
post_max_size = 64M

answered Jul 16, 2015 at 19:45

loretoparisiloretoparisi

14.8k11 gold badges93 silver badges132 bronze badges

"Error : The uploaded file exceeds the upload_max_filesize directive in php.ini." Solved by uploading my theme manually. I was also facing the same problem while uploading wordpress theme, My theme is of 3.2MB in size. I searched for following line in wp-config.php file,

// this will change your max file size upload AND your php memory define( 'WP_MEMORY_LIMIT', '64M' );

But it was not found. so I tried another approach, I Log into cpanel went into the directory where wordpress is install then /wp-content/themes, choose upload option and upload my theme and it get installed. :D

answered Jul 13, 2016 at 11:32

Upload_max_filesize directive in php ini cpanel

Amol JAmol J

1092 silver badges12 bronze badges

Select PHP Version. Switch to PHP Options upload_max_filesize 128MB

answered Sep 7, 2016 at 23:33

Upload_max_filesize directive in php ini cpanel

alpcalpc

5383 silver badges6 bronze badges

Create php.ini file and paste below code and upload in public_html its working fine for me.

[PHP]
file_uploads = On
post_max_size = 750M
upload_max_filesize=750M
max_execution_time=5000

answered Mar 7, 2017 at 6:31

Upload_max_filesize directive in php ini cpanel

How do you fix the uploaded file exceeds the upload_max_filesize directive in PHP ini from cPanel?

Option 1: Edit the .htaccess File (cPanel).
Option 2: Edit the .htaccess File using Command Line Interface..
Option 3: Editing wp-config.php File..
Option 4: Edit the wp-config.php File from Command Line Interface..
Option 5: Edit php.ini File..
Option 6: Contact Host's Support..

What is upload_max_filesize directive in PHP ini?

The uploaded file exceeds the upload_max_filesize directive in php. ini is an error that occurs on your WordPress site when you upload a file that exceeds the limitations set by your webserver. As scary as this error may seem, the solutions are pretty straight-forward.

How do I change upload_max_filesize directive in PHP ini?

Open cPanel. Go to Select PHP Version > PHP Options/Options. Or, in some situations, you might need to look for a tool called MultiPHP INI Editor. Change the value for upload_max_filesize according to your needs.

How can I change max post size in PHP in cPanel?

In order to do that, access your cPanel → Software section → Select PHP Version: Then, you can select Options, where you can locate the upload_max_filesize and set the maximum value available in your plan. If the errors persist, you can increase additional PHP limits by adding a few lines of code to your .