Run as non root?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Muffinthief
    New Member
    • May 2007
    • 51

    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.
  • dlite922
    Recognized Expert Top Contributor
    • Dec 2007
    • 1586

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





    _Dan_

    Comment

    • pbmods
      Recognized Expert Expert
      • Apr 2007
      • 5821

      #3
      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?

      Comment

      • Muffinthief
        New Member
        • May 2007
        • 51

        #4
        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.

        Comment

        • pbmods
          Recognized Expert Expert
          • Apr 2007
          • 5821

          #5
          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.

          Comment

          Working...