Why cannot I use php to create new files in linux?-php Tutorial

Source: Internet
Author: User
Tutorial: why can't I use php to create a new file folder in linux and set it to 777? why can't I use file_put_contents in php to create a new file? ps: in windows, there is no problem. could you please advise? Solution: ------------------ what is the php version? Try fopen () and fwrite () ------ solution ------- Tutorial: why cannot I use php to create new files in linux?
I set the folder permissions to 777. Why can't I use file_put_contents in php to create a new file?

Ps: There is no problem in windows.


Please kindly advise



------ Solution --------------------
What is the php version?

Try fopen () and fwrite ().
------ Solution --------------------
Is 0777 is not 777.
------ Solution --------------------
Apache has no permission to write files.

Chown.
------ Solution --------------------
To start apache, you must have the write permission on your Directory.
It is not a simple 777 solution.
Pay special attention to permission issues in linux.
------ Solution --------------------
... 777 don't mess with it...

Not only the target directory, but the directory on this path must have the read permission for your php container users and the write permission for the target directory.
------ Solution --------------------
The correctness of the path may be ignored.

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.