12
9
I have a php script that uploads a file to a directory called "uploads". The only way I can get the upload to work is if I do:
chmod 777 uploads
I know this isn't correct but I don't know what I am supposed to do to get it to work.
Server info: T1-Micro Amazon Linux AMI 2013.03 on Amazon EC2
Questions:
How do I find out what users need access... e.g., what is the user name for apache or the web server?
What level of access do I need to give and what command would I use to do that.
Thanks!
Edit: I found lots of answers on stack overflow which I will research. For example
https://stackoverflow.com/questions/3642241/php-file-upload-permissions
https://stackoverflow.com/questions/10842880/setting-permissions-in-php-on-server
Thanks
Clear and straightforward solution, Thanks a lot. Now i don't need the risky 777 permission any more – lhrec_106 – 2016-05-16T04:52:37.153
Thanks. This helped a lot. apache is the user. sudo chown and sudo chmod commands both work. – fun_programming – 2013-04-12T20:07:38.737