skip to Main Content

As the title suggests, I am clashing against a very trivial thing, my hosting gives me the possibility to upload a file on the WP platform, up to 150mb, per test, I wanted to increase this value I tried in the three different modes that carry but none of them work, and I always result in 150mb

1) Create php.ini

as soon as I access ftp to my site in the main root if I don’t have php.ini I create it, going to implement inside it:

upload_max_filesize = 256M
post_max_size = 256M
memory_limit = 3000M
file_uploads = On
max_execution_time = 300

2) Update .htaccess

within my public_html / in the .htaccess file I’m going to implement:

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

final result:

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

# 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

# SP BEGIN php handler
<IfModule mod_fcgid.c>
          AddHandler fcgid-script .php .php5 .php7 .phtml
          FcgidWrapper    /usr/local/cpanel/cgi-sys/sp-ea-php71 .php
          FcgidWrapper    /usr/local/cpanel/cgi-sys/sp-ea-php71 .php5
          FcgidWrapper    /usr/local/cpanel/cgi-sys/sp-ea-php71 .php7
          FcgidWrapper    /usr/local/cpanel/cgi-sys/sp-ea-php71 .phtml
</IfModule>
# SP END php handler

but I get the error: 500 Internal Server Error

3) Directly from the wp-config.php file

where I’m going to implement:

define ('WP_MEMORY_LIMIT', '256M');

but I always get 150mb uploads, how can I increase?

3

Answers


  1. The 3rd method which you have mentioned just needs a little modification in order to work.

    define( 'WP_MEMORY_LIMIT', '256m' ); // (need the comma otherwise from error)
    define( 'WP_MAX_MEMORY_LIMIT', '256M' );
    

    Add the above two lines just after define( 'WP_DEBUG_LOG', true ); code in your wp-config.php file.

    This should work for you 🙂

    Login or Signup to reply.
  2. If you don’t have access to WHM, Talk to your hosting provider to increase upload memory limit. Shared hosting memory limit you can’t increase in any way.

    Login or Signup to reply.
  3. Add a phpinfo file and call it in browser. You will get to know exactly which PHP ini file is being loaded. You need to increase the upload_max_filesize and post_max_size in that ini file.

    Most probably, it will be limited by the hosting company. Contact the hosting provider to get this sorted.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search