PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I can use a small script to create a new text file in the same directory as the script is running using $fp=fopen("test.txt","w") and that works fine but if I try to create it in a different directory using $fp=fopen("../Data/test.txt","w") it fails saying I don't have the permission to do this! I have full 777 permissions set on both the directory the script lives in and on the Data directory so what am I doing wrong?
I tried that, I used $DOCUMENT_ROOT."/Data/test.txt" and still got told I didn't have the permission so I even put it in manually and same result I'm guessing its something to do with permissions but I've got all the folders set to 777 and all the files I can find too!
Now there goes that "User" thing again! I'm used to NT where I don't see these problems so whats this user, group, world thing and how does the script/server know which one I belong to? I just simply call the script from a browser window but in the long term it will be called from a Flash program
usually, the webserver runs as the "nobody" user with normal user read/write restrictions. so, as long as the directory is world-writeable, it should be fine....
Yes, I've got the directory set up to 777! I can create the file from the script fine if its in the same directory as the script, the problem comes when I try to create the file in a different directory from the script. I created a sub directory to where the script is and set its permissions to 777 and then tried to get the script to create the file in it and I got the "not allowed" message. Seems very strange to me!