The uploaded file exceeds the upload_max_filesize directive in php ini error Meals that something wrong with a php.ini file is going. First, let’s find out what this file is for.
The php.ini file is the main PHP configuration file. WordPress uses the PHP programming language, and this file controls everything. Some hosting providers set up its configuration to the maximum parameters and do not allow to change it globally. However, in most cases it is possible.
If you do not know where the php.ini file is located on the server, do the following steps:
Start a text editor and type the following line of code in it:
<?php phpinfo(); ?>
Save the created file and name it info.php
Via the FTP manager, connect to the hosting server where your site is located and copy the info.php file to the website root directory.
Now, in the address bar of your browser type http://example.com/info.php, where instead of example.com type in your website address.
Among other settings, check the value of the following three parameters:
memory_limit — the maximum memory size allowed by the hoster to run scripts on the website;
post_max_size — allowed size of a one-time file import request;
upload_max_filesize — the maximum amount of data that can be uploaded to the site per time.
To increase the allowed maximum file size, you need to adjust the values specified in upload_max_filesize and post_max_size parameters. If you use the virtual hosting, most likely you will not have full access to the global server settings. As a rule, full access to this file is available on the local server or on a VPS hosting.
If you have access, open the php.ini file in edit mode and set the new upload_max_filesize and post_max_size values. The upload_max_filesize value should be less than post_max_size, and the post_max_size value should not be higher than the memory_limit. Do not forget to back up the site and save a backup copy of the php.ini file before you make any changes.
It must look like the following:
If you do not have access to the php.ini file, adjust the necessary values in the user.ini file. The path to it is indicated in the “Additional .ini files parsed” section when opening the info.php file. This method works for PHP version 5 or higher.
- Run a text or code editor and name the file user.ini.
- Add the necessary parameters to memory_limit, post_max_size and upload_max_filesize.
- Using the file manager, copy the user.ini file to the root directory of the site, upload the page and try to upload the file again.
Contact the hosting support
In many cases, it will be much easier to contact the technical support of your hosting provider and ask them to solve the issue. Remember that they may possibly not be able to change the parameters if your plan does not allow to do that. In that case, you may require to change it.
If demo data importer fails, upload attached xml file via WP ADMIN / TOOLS / IMPORT / WORDPRESS.
Then go to wp admin / ultimate addons / icon manager - > upload icon pack zips.