The size of the file uploaded by WordPressImport exceeds the value of upload_max_filesize defined in php. ini-> solution

Source: Internet
Author: User
Tags php file upload
The size of the file uploaded by WordPressImport exceeds the value of upload_max_filesize defined in php. ini -- & gt; solution. Reference 1: WordPressImporter encountered the following error when uploading and importing backup files: "The size of the uploaded file exceeds the size of upload_max_filesize defined in php. ini ;". The cause is that the size of the WordPress Import file uploaded by php. ini exceeds the value of upload_max_filesize defined in php. ini --> solution.

Reference 1:

This error occurs when WordPress Importer uploads and imports a backup file and prompts "the size of the uploaded file exceeds the upload_max_filesize value defined in php. ini ". The cause is that the maximum size of the uploaded file is limited in the php. ini file. the default value is 2 MB. to solve this problem, find the file and modify it as follows.

The above is an error message. Solution: open php first. you can find the ini file in the specific path. I have not tested it on the server. the XAMPP local environment (under the xampp/php folder) is used ), search for upload_max_filesize = 2 M and post_max_size = 8 M respectively, change the maximum file upload limit, for example, to 40 M, save, and restart the apache service.

After the modification, we will try to upload and import again. at this time, we can, for example, upload a larger file. After the import, you can modify the original size. remember to restart the apache service.

Some users who use virtual hosts do not have this permission, and there is a work und. Export WordPress XML backup files in batches, such as batch export by category, tag, user, and time, and then upload and import them one by one. In addition, there are some XML File splitting software, such as the WordPress XML File Splitter and WXR File Splitter (which can customize the split size), which is also very convenient to use.

Reference 2:

Change the value of post_max_size = 2 M (2 M by default) to the desired size, for example:
Post_max_size = 100 M
We usually do this step to solve the problem. In fact, you still need to take a look at the following steps.


Upload_max_filesize indicates the maximum value of the uploaded file.
Find upload_max_filesize. the default value is 8 MB.
Upload_max_filesize = 100 M

It should be noted that the post_max_size is better than the upload_max_filesize setting.

Finally, restart apache after the configuration is complete.

For details, refer to [PHP. ini core configuration options] in the php Manual 〕
The maximum size of the file uploaded by upload_max_filesize.
Post_max_size: set the maximum size allowed by POST data.
Memory_limit specifies the maximum number of memory bytes that a script can apply.


The default size of PHP files to be uploaded is 2 MB. to upload files that exceed this setting, you need to adjust some parameters such as PHP and apache. next, we will briefly introduce some parameters involved in php file upload:

File_uploads
Whether to allow file upload over HTTP. ON is enabled by default.

Upload_tmp_dir
Upload_tmp_dir indicates the temporary directory where PHP files are uploaded. to upload files, make sure the server does not have the permission to close the temporary files and write the files to the folder. if not specified, PHP uses the system default value.

Upload_max_filesize
Maximum file size that can be uploaded. the default value is 2 MB.

Post_max_size
Controls the maximum data size that PHP can receive in a form submission using the POST method. If you want to use the php file upload function, you need to change this value to a value greater than upload_max_filesize.

Max_input_time
The time for receiving data through POST, GET, and PUT is limited in seconds. If the running environment of the application is on the low-speed link, you need to add this value to adapt to the more time required to receive data.

Memory_limit
To avoid using a large amount of available memory by running scripts, PHP allows you to define the memory usage limit. Use the memory_limit variable to specify the maximum memory capacity variable memory_limit that can be used by a single script program. The value of memory_limit should be greater than the value of post_max_size.

Max_execution_time
Max_execution_time sets the time for PHP to wait for the script to be executed before the script is forcibly terminated. The time is calculated in seconds. This variable is useful when the script enters an infinite loop state. However, when there is a legal activity that takes a long time to complete (such as uploading large files), this function will also cause operation failure. In this case, you must consider increasing the value of this variable to prevent PHP from closing the script when the script is executing an important process.

It seems that php. ini has to be clear about its powerful functions.





Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.