Fix the uploaded file exceeds the upload_max_filesize directive in php.ini

Admin   PHP   56  2020-07-03 23:50:09

Does the uploaded file exceed the upload_max_filesize directive in php.ini? You often encounter this error when uploading data to the website?

1. The cause of the uploaded file exceeds the upload_max_filesize directive in php.ini

Plugins and themes are important components when building a WordPress website. However, in some cases, when you install a Plugin or Theme, you get the error "the uploaded file exceeds the upload_max_filesize directive in php.ini". Of course, when you encounter that error, you will not be able to install the Plugin or Theme anymore.

The above error is due to the default maximum hosting provider uploaded to Hosting. Therefore, when you upload a file larger than the specified level, an error message will appear. If you want to check the maximum limit when uploading a file to Hosting, you can go to: Media menu => Add file => Check

2. Fix the uploaded file exceeds the upload_max_filesize directive in php.ini

2.1 Fix the uploaded file exceeds the upload_max_filesize directive in php.ini by editing php.ini via cPanel

Step 1: Navigate to "MultiPHP INI Editor"

Fix the uploaded file exceeds the upload_max_filesize directive in php.ini by editing php.ini via cPanel

Step 2: Choose your website

Step 3: Edit "upload_max_filesize" based on your needs

Fix the uploaded file exceeds the upload_max_filesize directive in php.ini by editing php.ini via cPanel 1

2.2 Fix the uploaded file exceeds the upload_max_filesize directive in php.ini by editing the php.ini file on DirectAdmin Hosting

Step 1: Log in Hosting

Step 2: Select the domain name you want to change the PHP version

Step 3: Select "Select PHP version"

Step 4: Customize the PHP version including PHP Extension, PHP Settings

Fix the uploaded file exceeds the upload_max_filesize directive in php.ini by editing the php.ini file on DirectAdmin Hosting 3

Customize the PHP Extension version

2.3 Fix the uploaded file exceeds the upload_max_filesize directive in php.ini by fixing php.ini via FTP

Step 1: Connect the server via FTP

Step 2: Go to the website's root directory

Step 3: Find the php.ini file in the root directory (if not found, create a new directory and name it php.ini)

Step 4: Add or edit the following code:

upload_max_filesize = 12M
 
post_max_size = 13M
 
memory_limit = 15M

2.4 Fix the uploaded file exceeds the upload_max_filesize directive in php.ini by editing the .htaccess file

Step 1: Connect the website via FTP to edit the .htaccess file

Step 2: Add the following code to adjust the value based on your needs:

php_value upload_max_filesize 12M
 
php_value post_max_size 13M
 
php_value memory_limit 15M

3. Parameters that affect file upload limit in php.ini

3.1 Upload by MB

upload_max_filesize = 500M
    post_max_size = 500M
    max_allowed_packet = 500M
    memory_limit = 500M

3.2 Timeout time in milliseconds

    default_socket_timeout = 30
    max_execution_time = 30
    max_input_time = 30

 

The article helps you understand the causes and how to fix the uploaded file exceeds the upload_max_filesize directive in php.ini.