Forum Moderators: phranque

Message Too Old, No Replies

Can't write file to a created folder

         

marcusl

8:03 am on Apr 14, 2010 (gmt 0)

10+ Year Member



Hey guys. Hope you're well.

I have a php script on my server. The php script creates a new folder called "test", then set that folder's permission to 777. Next, I attempt to save a file into the "test" folder, but it doesn't work. As a test, I logged in as the admin using FileZilla, then created a folder named "test2". I ran another php script to save a file into the "test2" folder, and that worked fine. Both "test" and "test2" have 777 permissions. The only difference is that "test" has "apache apache" under "Owner/Group", and "test2" has the admin details under "Owner/Group". I want to create a folder via php, then save a file inside that folder.

Thanks for your help.

jdMorgan

1:07 pm on Apr 14, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You may need to investigate how to declare and/or change the "owner" of the directories and files from within PHP. At the *nix OS level, this is the "chown" shell command.

Jim