| Author |
Message |
MikeyCarter
Joined: 02 Jan 2006 Posts: 8 Location: Orangeville, ON
|
Posted: Wed Feb 01, 2006 9:02 pm Post subject: Web site runs as one user, php runs as another. |
|
|
I just wanted to document and issue with PHP for everyone to see. This way people won't get as confused as I did.
When the web server runs it reads files as your username (ie myuser). So pretty much all your files will be created with this in your home directory.
php however uses the user nobody for all it's file operations. fopen, mkdir, chown, chmod, etc. So if your creating files from a php web page it will create the files with the user nobody. This means if you have SSH or file manager it may be impossible to access the file if the permissions are 700.
Now that these files are created if your web page loses track of them their impossible to delete without using a php script or getting the tech team to delete them as root.
So if you run into files you can't clean up. This could be your problem. |
|
| Back to top |
|
 |
sjsorell
Joined: 24 Aug 2005 Posts: 17 Location: Calgary, AB
|
Posted: Thu Mar 02, 2006 11:13 pm Post subject: |
|
|
Hey thanks MC! I am having some file deletion issues right now with my site. Isn't it possible for the CWH tech guys to give users full permission with those kinds of files so we CAN delete them with SSH or the control panel? Give us "nobody" permission or put us in the nobody group? Maybe how php runs can be modified to use our usernames instead? Is that possible CWH tech?
Thanks again for posting MC! |
|
| Back to top |
|
 |
kevin CWH Staff
Joined: 13 Dec 2004 Posts: 209 Location: Vancouver, BC
|
Posted: Fri Mar 03, 2006 10:49 am Post subject: |
|
|
| There is a way to run it as the username instead of nobody. It's phpsuexec but if we run it on a current server, it breaks current php scripts. Plus php accelerator is not compatible with it. Sjsorell, email our tech dept and we'll do the same workaround as mikeycarter. |
|
| Back to top |
|
 |
sjsorell
Joined: 24 Aug 2005 Posts: 17 Location: Calgary, AB
|
Posted: Sat Mar 04, 2006 10:17 am Post subject: |
|
|
| ok. Thanks Kevin! |
|
| Back to top |
|
 |
|