Php uploads files to the server. the server operating system is centos-php Tutorial.

Source: Internet
Author: User
When uploading files to the server in php, the project created by the server operating system for centos is based on the yii framework. one of the file upload functions is implemented using the xupload plug-in.
After a user uploads a file, the script creates a folder for the current Upload time in the root directory of the target server (OS: centos), for example, 2014_8_3_8_39, and then writes the file to it.
This code can be uploaded after being deployed on several servers. However, a problem occurs on the target testing machine: folders can be created, but the content is empty, that is, files are not uploaded.
The younger brother checked the httpd log and did not find any problems. In php. ini, it is useless to change the size of the uploaded file. However, in the same operating system of other machines, the same php version is okay.
So I think it may be a problem with the configuration of that machine. I am very grateful to anyone who doesn't know much about linux!


Reply to discussion (solution)

Upload a small file of several k to determine if it is not a php configuration problem.
Creating an upload folder in the root directory is an error.
This will inevitably lead to various permissions. Files cannot be accessed by the web.

The cause of the problem has been found, because the background programmer directly removed the file, so it is empty.

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.