php permissions
Posted: Fri Sep 23, 2011 2:20 pm
Hey all,
I may have posted this in the wrong section at first...
I'm having a bit of a problem trying to set up a custom php script.
Here's what's going on:
I have an upload script that allows registered users to upload files to a temp /upload/ directory.
Upon review from admins the files need to be copied to another folder.
At first I had a problem with open_basedir restrictions but after fixing that with a vhost.conf file I was able to bypass that.
My real issue now is not so much about php itself but rather related to linux permissions.
I get a permission denied when trying to copy the files and it's my understanding that apache/php does not have permission to write to the destination folder.
In theory I think I know what needs to be done I just don't have the skills to pull this off, so any help is welcomed.
Here's what I'm thinking.
PHP needs write permission to the destination folder.
I've tried the following.
Switched php from running as an apache module to fastcgi...
The /destination/ folder is owned by user: 'domainadmin' (created by plesk when the domain is set up initially) and group: 'psacln'
the php script is owned by the same: domainadmin | psacln
when loading the script i get --> Permission denied
I chmodded the /dest/ folder to 777 and tried it again.
The file gets copied fine now but it is owned by apache | apache
Shouldn't fastcgi make all php scripts run as the 'domainadmin' ??? and not needing any higher perm than 755??
Lastly I need the domain admin account to be able to see those copied files via FTP.
Please be as detailed as possible. I'm a big noob but willing to learn fast
Setup is dedicated box running RHEL + Plesk
I've been trying to make this work for over a week now. I'm tired, confused and can't figure out what needs to be done.
Any help is greatly appreciated.
c
I may have posted this in the wrong section at first...
I'm having a bit of a problem trying to set up a custom php script.
Here's what's going on:
I have an upload script that allows registered users to upload files to a temp /upload/ directory.
Upon review from admins the files need to be copied to another folder.
At first I had a problem with open_basedir restrictions but after fixing that with a vhost.conf file I was able to bypass that.
My real issue now is not so much about php itself but rather related to linux permissions.
I get a permission denied when trying to copy the files and it's my understanding that apache/php does not have permission to write to the destination folder.
In theory I think I know what needs to be done I just don't have the skills to pull this off, so any help is welcomed.
Here's what I'm thinking.
PHP needs write permission to the destination folder.
I've tried the following.
Switched php from running as an apache module to fastcgi...
The /destination/ folder is owned by user: 'domainadmin' (created by plesk when the domain is set up initially) and group: 'psacln'
the php script is owned by the same: domainadmin | psacln
when loading the script i get --> Permission denied
I chmodded the /dest/ folder to 777 and tried it again.
The file gets copied fine now but it is owned by apache | apache
Shouldn't fastcgi make all php scripts run as the 'domainadmin' ??? and not needing any higher perm than 755??
Lastly I need the domain admin account to be able to see those copied files via FTP.
Please be as detailed as possible. I'm a big noob but willing to learn fast
Setup is dedicated box running RHEL + Plesk
I've been trying to make this work for over a week now. I'm tired, confused and can't figure out what needs to be done.
Any help is greatly appreciated.
c