Login or Sign up Help | Site Map
Connecting Tech Pros Worldwide

Run as non root?

Question posted by: Muffinthief (Member) on July 6th, 2008 07:00 PM
Hey guys,
I'm running php 5.2.6 on an apache server. All I'm trying to do is write a simple script to run a program on the server, but I need to run it as a regular user. Does anybody know how to do this?

Thanks in advance.
Would you like to answer this question?
Sign up for a free account, or Login (if you're already a member).
dlite922's Avatar
dlite922
Site Addict
531 Posts
July 6th, 2008
08:00 PM
#2

Re: Run as non root?
just give read or execute permission to all on the file and PHP will be able to read.





_Dan_

Reply
pbmods's Avatar
pbmods
Moderator
5,076 Posts
July 6th, 2008
08:04 PM
#3

Re: Run as non root?
Heya, Muffinthief.

Apache should be configured to run as (generally) www, apache or nobody. This value can be changed in httpd.conf in Apache's configuration directory.

If your webserver is executing scripts as root, you need to fix this ASAP! Look for the User directive in httpd.conf (http://httpd.apache.org/docs/2.3/mo...ommon.html#user).

Who is your hosting provider?

Reply
Muffinthief's Avatar
Muffinthief
Member
46 Posts
July 7th, 2008
01:32 AM
#4

Re: Run as non root?
Thanks pbmods, that's what I needed. As for my hosting I just have my own server running on localhost for testing. I left it at the default and the program that I was running approximated that as root.

Reply
pbmods's Avatar
pbmods
Moderator
5,076 Posts
July 7th, 2008
01:41 AM
#5

Re: Run as non root?
Glad to hear you got it working! Good luck with your project, and if you ever need anything, post back anytime!

I'm going to go ahead and move this to the Apache forum for reference.

Reply
Reply
Not the answer you were looking for? Post your question . . .
182,325 Experts ready to help you find a solution.
Sign up for a free account, or Login (if you're already a member).

Top Apache Forum Contributors