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.
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.