How to increase Maximum Upload size in cPanel?

2020-02-08 15:08发布

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.

12条回答
一纸荒年 Trace。
2楼-- · 2020-02-08 15:51

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
查看更多
女痞
3楼-- · 2020-02-08 15:56

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.

查看更多
来,给爷笑一个
4楼-- · 2020-02-08 15:56

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

查看更多
来,给爷笑一个
5楼-- · 2020-02-08 15:59

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 .

查看更多
地球回转人心会变
6楼-- · 2020-02-08 15:59

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.

查看更多
Bombasti
7楼-- · 2020-02-08 16:02

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
查看更多
登录 后发表回答