Hey there /Prog/, I am unable to change permissions of my files in my apache's www folder. I realize this was for security reasons so I was wondering if there was a way to access folders not on my www directory for use by my php scripts. I have changed directories and I have used file_put function and when I echo my current directory it tells me I am on my desktop but I cant seem to create a file there. I would be grateful if you all had knowledge to drop on me.
this board is full of 13 year old fan boys and 12 year old internet racists and doesn't afraid of anything.
Name:
Anonymous2012-02-07 14:19
>>7
Someone please prove me wrong. There is crazy lack of information out there on the subject. No one seems to be doing this kind of stuff.
Name:
Anonymous2012-02-07 14:23
>>1
No. If you have no superuser access, you're SOL.
Name:
Anonymous2012-02-07 14:40
>>9
I have superuser I just cannot change any permissions on files or folders. There has to be a way to give permissions to my scripts.
Name:
Anonymous2012-02-07 14:58
If you're running your PHP "scripts" via mod_apache (aka through a web server), they have the same permissions as the user running apache, probably something like "apache" or "httpd". This user won't have permission outside of the /var/www/ directory (or similar).
If you're running your "scripts" via the PHP command-line interface (CLI), they have the permissions of the user you run them with.
You could allow PHP to create files on your desktop by adding the apache user to your user's group, but this is bad practice (and you don't seem to know what you're doing at all). Or you can create folders with global write access, so any user can write to them.
Read up on Unix users/groups, and the commands chown and chmod.
Name:
Anonymous2012-02-07 15:04
>>11
The second option is what I want but even with chmod the permissions are locked. I cannot seem to modify any permissions
>>12
"I cannot seem to modify any permissions" - could you be any more vague? If you really have super user access, you can modify permissions. The only explanation is you're using the commands incorrectly.