PHP cannot move to the specified directory after uploading a file to resolve

Source: Internet
Author: User

Users that trigger PHP scripts to run from browser access are Apache users

Unable to move file because the target directory does not have write permission

1. Set the target directory permission to 777

#chmod 777 Tar_dir

2. Set the target directory user and user group to Apache

#chown Apache.apache Tar_dir

* The second method is recommended, and the service is restarted after modification.

* If the move fails, it is a problem with selinux (you can choose to turn selinux off or make the relevant configuration).

* Disable SELinux mode (requires restart of computer)

PHP cannot move to the specified directory after uploading a file to resolve

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.