Modify four methods to increase the maximum upload file size of WordPress media library

4 minutes
eight hundred and fifty-two
zero

1、 Modify or create php.ini
Php.ini (located in the root directory of the managed account) is a configuration file that allows you to customize PHP's behavior at run time. It contains a list of settings, including the maximum upload file size, maximum execution time, upload directory, global variables, and display errors.

For security reasons, almost all hosting service providers hide it. To access files, log in to the hosting account, navigate to the root directory, and search for php.ini. Remember to turn on the "Show hidden files" function. If there is no such file, please create a new file with the following name: "php. ini". Ensure that the file contains the above three variables.

Since we need to set the maximum file upload size to 20 MB, I will change the upload_max_filesize to 20 MB and post_max_size to 25 MB to use a 20 MB file in the body of the post. It is a good practice for post_max_size to exceed upload_max_filesize.

upload_max_filesize = 20M

post_max_size = 25M

memory_limit = 30M
Note that some hosting service providers have renamed the file php5.ini.

2、 Modify (or create). htaccess file

WordPress. htaccess is the abbreviation of Hypertext Access, which is the configuration file used by Apache server. Typically, it is located in the root directory. If the file does not exist, create it with the exact file name and extension ". htaccess".

Assuming you have the file, copy and paste the following lines of code below the file:

 php_value upload_max_filesize 20MB php_value post_max_size 25MB php_value memory_limit 30MB


Note: When searching for. htaccess, do not forget to mark "Show hidden files". Your hosting service provider may hide it.

3、 Modify WordPress files
The above two methods are the most recommended methods to increase the file upload size. However, for other special reasons, when these methods do not work, you need to edit the configuration file of WordPress. Open the wp-config.php or functions.php file and paste the following lines of code:

@ini_set( ‘upload_max_size’ , ’20MB’ );

@ini_set( ‘post_max_size’, ’25MB’);@ ini_set( ‘memory_limit’, ’30MB’ );

4、 Increase the size of WordPress uploaded files through plug-ins

The advantage of WordPress is that it has many excellent plug-ins. If you do not want to increase the file upload size manually, you can use the name "Increase Maximum Upload File Size", and just enter a value in bytes (1024000 bytes=1 MB). For 20 MB, multiply 1024000 by 20 and enter 20480000 in the text box. Click Save Changes.

The plug-in can automatically detect the file upload size and increase the file upload size. Just activate the plug-in, go to "Increase Maximum Upload File Size" on the sidebar, and set the maximum file upload size.

When uploading larger files, it is convenient to upload them via FTP.

This article is written by: Chief Editor Published on Software Development of Little Turkey , please indicate the source for reprinting: //hongchengtech.cn/blog/167.html
Kuke_WP editor
author

Related recommendations

1 year ago (2024-02-20)

Industry Fit! Preferred element of WMS warehouse management system, wms warehouse software

Enterprise managers often think that warehouses are inefficient, high cost places, and belong to heavy asset operations. With the development of enterprise business, if the warehouse needs to be expanded in traditional ways, the cost is relatively high. At the same time, it also faces problems such as lack of operating experience. In the operation link, the process of warehouse, allocation, human resource matching and management is very complicated, and the team's professional ability is also highly required
seven hundred and eighty-three
zero
1 year ago (2024-02-19)

Supply chain billing system management (I): system overview, what are the supply chain management fees

In recent years, with the continuous development of e-commerce industry and increasing business, everyone has started to distribute goods online, and the supply chain billing system needs to manage more and more things. How to manage the billing system? The author summarizes some contents about settlement based on his own practical experience, hoping to enlighten you. After working on the warehouse management system for several years, I was transferred to work as a supplier
five hundred and fifty-four
zero
1 year ago (2024-02-19)

Multi merchant system management - store background design, what is the meaning of multi merchant classification

Simply understood, multi merchants are a large mall. The platform can manage merchants who settle in the mall. The merchants who settle in the mall have independent backstage. They can log in and add goods to the shelves by themselves, manage stores by themselves and other information functions. Then how to design the backstage of the store? Let's see the author's sharing. I hope it can help you. 1、 Introduction The backstage of the store is an important part of the e-commerce platform
six hundred and forty-six
zero
1 year ago (2024-02-19)

Jiangyang District of Luzhou City took the lead in the city's full coverage training on domestic waste classification management regulations, Luzhou waste treatment

Source: Original Draft On January 10, the People's Congress of Jiangyang District, Luzhou City and the District Government jointly carried out a training on the regulations of the Regulations on the Classified Management of Domestic Waste in Luzhou City (the Regulations for short), and invited Lei Zhengyun, the chairman of the Legislative Affairs Committee of the Municipal People's Congress, to give a live lecture, so as to guide the comprehensive and systematic grasp of the contents and legal functions and responsibilities of the Regulations, deeply understand the specific specifications of the Regulations, and quickly set off
three hundred and seventeen
zero
1 year ago (2024-02-19)

Simeng CMS (smcms) content management system, Simeng Central Primary School

SMCMS (Simon CMS) is a content management system developed based on the microbee http rapid development framework. Product development follows the concept of simplicity, security, high concurrency and efficiency. Enterprise level web content management software for high-end users is designed to help users solve the increasingly complex and important web content creation, maintenance, publishing and response
three hundred and sixty-one
zero
1 year ago (2024-02-19)

Does the website have to install a content management system?, What apps are needed to install software on the website

1: The role of the website is to let companies or enterprises display their own windows, but also to let more customers or potential customers know their work and products. Through the website, customers can understand their products and services more intuitively, and can also provide more services to meet customer needs. 2: The role of the content management system The content management system can help
four hundred and fifty-six
zero

comment

0 people have participated in the review

Scan code to add WeChat

contact us

WeChat: Kuzhuti
Online consultation: