Connecting Tech Pros Worldwide Help | Site Map

Run as non root?

Member
 
Join Date: May 2007
Posts: 51
#1: Jul 6 '08
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.
dlite922's Avatar
Expert
 
Join Date: Dec 2007
Location: Moon, Dark Side
Posts: 1,094
#2: Jul 6 '08

re: Run as non root?


just give read or execute permission to all on the file and PHP will be able to read.





_Dan_
pbmods's Avatar
Site Moderator
 
Join Date: Apr 2007
Location: Texas
Posts: 5,435
#3: Jul 6 '08

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/mod...mmon.html#user).

Who is your hosting provider?
Member
 
Join Date: May 2007
Posts: 51
#4: Jul 7 '08

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.
pbmods's Avatar
Site Moderator
 
Join Date: Apr 2007
Location: Texas
Posts: 5,435
#5: Jul 7 '08

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