Get the App
SLTechnology News&Howtos  ›  Development  › 

How to solve the problem that linux php cannot upload folders

Shulou Source: shulou.com Published: 2022-06-03 15:29:48 11月14日 Update

This article mainly introduces "how to solve the linux php can not upload folder problem", in daily operation, I believe many people in how to solve the linux php can not upload folder problem there are doubts, Xiaobian consulted all kinds of information, sorting out simple and easy to use operation method, hope to answer everyone "how to solve the linux php can not upload folder problem" doubts help! Next, please follow the small series to learn together!

Operating environment: linux 5.9.8 system, PHP 7.1 version, DELL G3 computer

Linux php cannot upload folders how to do?

php Unable to Upload File (Linux Server)

Today, I found out that suddenly I can't upload the file php.ini configuration is already.

Linux(Centos 5.3) + Apache + PHP +MySQL

Web site directory files: disk array sharing for mounting windows servers using smb

Site Directory Rights: 777

php.ini :

-----------------------------------------------------

upload_max_filesize = 200Mmax_file_uploads = 20post_max_size = 200Mmax_execution_time = 60000max_input_time = 6000;max_input_nesting_level = 64memory_limit = 256M

------------------------------------------------------

CMS system has been prompted that there is not enough permission, check the relevant information to know that php.ini file has a temporary folder specified parameters (will upload all files into the temporary folder inside)

Namely:

-----------------------------------------------------

;upload_tmp_dir =

-----------------------------------------------------

The above default is comment, that is, virtual memory will be used for storage

When the memory is full, there will be a problem of not uploading files, that is, a 777 error will be prompted.

The df - h query results are as follows:

--------------------------------------------------------------------------------------

/dev/mapper/VolGroup00-LogVol00 29G 28G 0 100% //dev/sda1 99M 12M 82M 13% /boottmpfs 1014M 0 1014M 0% /dev/shm//192.168.1.100/website 322G 21G 301G 7% /www/web/website

----------------------------------------------------------------------------------------

tmpfs is full, so I changed it to create an upload_tmp folder in the mount directory, and set the "upload_tmp_dir = " to "upload_tmp_dir =/www/web/website/upload_tmp

"

After saving restart apache, resume upload.

Note: To give directory 777 permissions to upload include the following subdirectory chmod -R 777 directory name

Summary:

Temporary files are best set to mount disk space (preferably a little larger), because the default value of tmpfs will be 1/2 times the physical memory, upload a few files will soon be full, this will cause files to upload, so configure various website environments should pay attention to the directory where temporary files are stored.

At this point, on "how to solve linux php can not upload folder problem" learning is over, I hope to solve everyone's doubts. Theory and practice can better match to help everyone learn, go and try it! If you want to continue learning more relevant knowledge, please continue to pay attention to the website, Xiaobian will continue to strive to bring more practical articles for everyone!

Tags: Files folders questions directories websites Learning memory permissions Environment more Best Server disk system data help Tips Services configuration practical Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi Huawei Microsoft MariaDB OPPO Reno