Help | Site Map
Connecting Tech Pros Worldwide
Reply
 
LinkBack Thread Tools
  #1  
Old July 6th, 2008, 08:00 PM
Member
 
Join Date: May 2007
Posts: 51
Default Run as non root?

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.
Reply
  #2  
Old July 6th, 2008, 09:00 PM
dlite922's Avatar
Site Addict
 
Join Date: Dec 2007
Location: US
Age: 23
Posts: 624
Default

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





_Dan_
Reply
  #3  
Old July 6th, 2008, 09:04 PM
pbmods's Avatar
Site Moderator
 
Join Date: Apr 2007
Location: Texas
Age: 24
Posts: 5,290
Default

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?
Reply
  #4  
Old July 7th, 2008, 02:32 AM
Member
 
Join Date: May 2007
Posts: 51
Default

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
  #5  
Old July 7th, 2008, 02:41 AM
pbmods's Avatar
Site Moderator
 
Join Date: Apr 2007
Location: Texas
Age: 24
Posts: 5,290
Default

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

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles