Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the problem that linux cannot upload files greater than 2m

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces "how to solve the problem that linux cannot upload files greater than 2m". In daily operation, I believe many people have doubts about how to solve the problem that linux cannot upload files greater than 2m. Xiaobian consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful for you to answer "how to solve the problem that linux cannot upload files greater than 2m". Next, please follow the editor to study!

Solution.

[root@2193 etc] # vi php.ini

; Maximum allowed size for uploaded files.

Upload_max_filesize = 10m

; Maximum size of POST data that PHP will accept.

Post_max_size = 15m

[root@2193 etc] # / etc/rc.d/init.d/httpd restart

Stop httpd: [OK]

Start httpd: [OK]

=

Parameters involved in PHP uploading files

The default upload limit for PHP is 2 MB. If you want to upload files that exceed this setting, you need to adjust some parameters such as PHP, apache, etc. Below, we briefly introduce some parameters involved in uploading PHP files:

File_uploads

The switch on whether to allow files to be uploaded via HTTP. Default is ON.

Upload_tmp_dir

Upload_tmp_dir is used to describe the temporary directory for files uploaded by PHP. If you want to upload files, make sure that the server does not close the temporary files and has write permission to the folder. If not specified, PHP uses the system default value.

Upload_max_filesize

The maximum file size allowed to be uploaded, which defaults to 2m

Post_max_size

Controls the maximum amount of data that PHP can receive in a form submission using the POST method. If you want to use the PHP file upload feature, you need to change this value to be larger than upload_max_filesize

Max_input_time

Limits the time to receive data by POST, GET, and PUT in seconds. If the environment in which the application is running is on a low-speed link, you need to increase this value to accommodate the more time required to receive data

Memory_limit

To prevent running scripts from making heavy use of system available memory, PHP allows you to define memory usage limits. Using the memory_limit variable to specify the maximum memory capacity variable memory_limit that a single script can use should be appropriately greater than the value of post_max_size

Max_execution_time

Max_execution_time sets the time, in seconds, that PHP waits for the script to finish executing before forcibly terminating the script. This variable is useful when the script enters an infinite loop state. However, this feature can also cause the operation to fail when there is a legitimate activity that takes a long time to complete, such as uploading a large file. In such cases, you must consider increasing the value of this variable to prevent PHP from closing the script when it is performing some important process.

At this point, the study on "how to solve the problem that linux cannot upload files greater than 2m" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report