How to increase Maximum Upload size in cPanel?
Asked Answered
L

12

20

I am using cPanel of my website to increase maximum upload file size for wordpress media uploads. I have used the codes(found out from google) for this purpose wp-config.php, .htaccess but nothing is working. In my cPanel, there is no service for php configuration editor under software / services section or anywhere else. Please help what should I do?

My .htaccess shows this code:

# 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 by placing the code:

php_value upload_max_filesize 20M
php_value post_max_size 20M

inside and outside # blocks, it gives 500 error rather.

Lunula answered 7/4, 2013 at 23:9 Comment(2)
are you unable to directly edit this in php.ini?Curia
No, I am not able to directly access php.ini.Lunula
L
3

I have found the answer and solution to this problem. Before, I did not know that php.ini resides where in wordpress files. Now I have found that file in wp-admin directory where I placed the code

post_max_size 33M
upload_max_filesize 32M

then it worked. It increases the upload file size for my worpdress website. But, it is the same 2M as was before on cPanel.

Lunula answered 13/4, 2013 at 19:16 Comment(0)
G
36

On cpanel -> software and services -> Select PHP Version.

Choose a PHP version which not the native one (I recommend php 5.6 or last one) and you will have / see a new link "Switch To PHP Settings", click it, in PHP Settings you can set upload_max_filesize in last line , clicking on value ( default is 2M ) , and you got a dropbox with values that you can set to upload_max_filesize, and click save .

Gambrinus answered 3/10, 2015 at 21:32 Comment(1)
Work for me, Thank you.Whole
C
16

Unfortunately, this is something you will have to ask you provider to do.

If your the owner of the server and can login to WHM it's under:

Tweak Settings => PHP Settings => Maximum Upload Size

Newer version have it listed under:

Home => Service Configuration => PHP Configuration Editor => Tweak Settings => PHP
Circumlunar answered 11/4, 2013 at 23:38 Comment(2)
In WHM 11.52, the area you need is: Home »Service Configuration »PHP Configuration Editor. Tweak Settings > PHP governs the cPanel max upload size, rather than the overall PHP upload_max_filesize.Airminded
What about the maximum upload file if you have mod security enabled?Varney
W
11

We can increase maximum upload file size for WordPress media uploads in 3 different ways.

That's are

  1. .htaccess way
  2. PHP.INI file method
  3. Theme’s Functions.php File

For .htaccess way, add following code,

php_value upload_max_filesize 1024M
php_value post_max_size 1024M
php_value max_execution_time 1000
php_value max_input_time 1000

for PHP.INI file method, add following code,

upload_max_filesize = 1024M
post_max_size = 1024M
max_execution_time = 1000

for Theme’s Functions.php File, add following code,

@ini_set( ‘upload_max_size’ , ’1024M’ );
@ini_set( ‘post_max_size’, ’1024M’);
@ini_set( ‘max_execution_time’, ’1000′ );

For More Details->>>

Wreak answered 29/4, 2014 at 10:53 Comment(1)
Mind the php.ini implementation- this file/modification should be located in the wp-admin directory not the root or public_html folder. Hope that helps, y'all- worked for me! :DCoir
M
9

On CPanel 64.0.40 (I didn't try any other version): Go in "Software" then "Select PHP Version" then "Switch To PHP Options" then upload_max_filesize => click on the value and select the one you prefer :) It's super hidden for such a critical option...

Marijo answered 21/9, 2017 at 11:24 Comment(1)
This should be the accepted answer. The page you go to may be "Software" => "MultiPHP INI Editor" depending on your version of cPanel.Rossi
L
3

I have found the answer and solution to this problem. Before, I did not know that php.ini resides where in wordpress files. Now I have found that file in wp-admin directory where I placed the code

post_max_size 33M
upload_max_filesize 32M

then it worked. It increases the upload file size for my worpdress website. But, it is the same 2M as was before on cPanel.

Lunula answered 13/4, 2013 at 19:16 Comment(0)
C
2

Since there is no php.ini file in your /public_html directory......create a new file as phpinfo.php in /public_html directory

-Type this code in phpinfo.php and save it:

<?php phpinfo(); ?>

-Then type yourdomain.com/phpinfo.php...you will see all the details of your configuration

-To edit that config, create another file as php.ini in /public_html directory and paste this code: memory_limit=512M
post_max_size=200M
upload_max_filesize=200M

-And then refresh yourdomain.com/phpinfo.php and see the changes,it will be done.

Cata answered 7/2, 2017 at 10:26 Comment(0)
C
1

In my case it was wp-admin/.user.ini:

post_max_size = 33M
upload_max_filesize = 32M
Cretin answered 5/12, 2015 at 12:1 Comment(0)
F
1

New Cpanel Settings on a Godaddy
From Cpanel go to:

  • Software
  • Select PHP version
  • Click "Switch To PHP Options" located on upper right hand corner

Increase post max size and upload max file size, save and your done.

Fear answered 13/5, 2016 at 13:54 Comment(1)
can't increase post_max_size more then 128MB.Tops
C
1

The solution is to create the php.ini file under your root directory. If the site is the wordpress installation then create the php.ini under your/path/to/wordpress/wp-admin/php.ini and add the following line of codes

[PHP]
post_max_size=120M
upload_max_filesize=132M
Cloudburst answered 4/2, 2017 at 10:11 Comment(0)
J
1

Login to your WHM panel if you have access to

Then go to Software -> MultiPHP INI Editor

Then select the php version from the dropdown, then scroll down for the upload_max_filesize which will be 2M by default, now increase it according to your need.

Also enable the file_uploads for HTTP file uploads for convenience.

If you don't have access to WHM, then follow the .htaccess method.

Junina answered 18/8, 2017 at 4:28 Comment(0)
S
0

php.ini settings should be like given below, if the '=' symbol is not put between the setting and value, it doesn't work

post_max_size = 100M

upload_max_filesize = 100M

Sift answered 6/3, 2014 at 12:14 Comment(0)
S
0

You should not replace the text entirely. Add the text after the "# END WordPress".

Sewing answered 24/5, 2014 at 17:41 Comment(1)
To prevent mistakes and missunderstandings, can you add some example code?Ionogen

© 2022 - 2024 — McMap. All rights reserved.