The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.
I'll be writing a PHP script to create a file, so the owner is going to be whatever user the PHP runs as on the server... The PHP needs read and write access to the file, but so do I (I'll probably be accessing the files via FTP). So I was thinking the easiest thing to do would be simply set the permissions to 666 (ie. Read and Write access for all users).
However, does this open the files up to anyone who can access the server? Because obviosuly it's hosting a bunch of websites on it, so by having Read and Write access for all, does that mean anyone who can access the server can also access the files?
Just curious and wondering how I should best proceed.
Cheers.
However, PHP has no interest in file extensions so theres some other force at work there.
Problem with this (and other random file extensions I tried experimenting with) is that the file doesn't seem to make use of the newlines I put in...
When using a .txt all the newlines show up nicely, however, everything else they don't... The "\n" characters don't show up either though, which was a little odd I thought.
Anyway, should I just stop messing about and use .txt or is there something I can do (or something I'm doing wrong) so the newlines show up okay?
Cheers again for the help!
> If you're going to use FTP to access the site then you'll be able
> to change whatever files you like (assuming you login with the
> correct user/password) so this won't be dependant on the file
> permissions.
Sure it will. FTP has to obey file permissions like everything else. Its perfectly possible to create files that you wont be able to touch under FTP.
Sibs,
Theres no simple answer to your question. In theory yes somebody else could access your files. However its dependent upon how the hosting is set up, what type of access you have to the server etc.. In most cases its unlikely and the result of poor security/configuration if they can. For instance, most hosts like to run PHP in safe mode these days so a script cant access anything outside the document root of the host (apart from a few defined directories like /tmp). Even if they get around that theres still no guarantees all the permissions of the directory tree will allow them access to the file.
Theres some risk, but its implicit in shared hosting really. In short, if you have a decent host, I wouldnt worry about it.
[URL]http://www.evolt.org/article/A_quick_and_dirty_chmod_Tutorial/18/541/[/URL] this may help...
I'll be writing a PHP script to create a file, so the owner is going to be whatever user the PHP runs as on the server... The PHP needs read and write access to the file, but so do I (I'll probably be accessing the files via FTP). So I was thinking the easiest thing to do would be simply set the permissions to 666 (ie. Read and Write access for all users).
However, does this open the files up to anyone who can access the server? Because obviosuly it's hosting a bunch of websites on it, so by having Read and Write access for all, does that mean anyone who can access the server can also access the files?
Just curious and wondering how I should best proceed.
Cheers.