Web site runs as one user, php runs as another.

General help with installation, scripts, etc....

Web site runs as one user, php runs as another.

Postby MikeyCarter » Wed Feb 01, 2006 10:02 pm

I just wanted to document and issue with PHP for everyone to see. This way people won't get as confused as I did. :D

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.
Going to or having a Garage Sale?
Try http://garagesale.carterfamily.ca to help you plot your route.

Have a joke or story to share?
Try http://theshadow.carterfamily.ca (The Shadow Writing Centre) to post your work.
Posts: 8
Joined: Mon Jan 02, 2006 8:16 pm
Location: Orangeville, ON

Postby sjsorell » Fri Mar 03, 2006 12:13 am

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!
Posts: 16
Joined: Wed Aug 24, 2005 1:17 pm
Location: Calgary, AB

Postby kevin » Fri Mar 03, 2006 11:49 am

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.
CWH Staff
Posts: 245
Joined: Mon Dec 13, 2004 12:48 pm
Location: Vancouver, BC

Postby sjsorell » Sat Mar 04, 2006 11:17 am

ok. Thanks Kevin!
Posts: 16
Joined: Wed Aug 24, 2005 1:17 pm
Location: Calgary, AB

Return to General Help

Who is online

Users browsing this forum: No registered users and 0 guests