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.