SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: php username?

  1. #1
    SitePoint Enthusiast LobsterMan's Avatar
    Join Date
    Apr 2005
    Location
    Jerusalem, Israel
    Posts
    94
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question php username?

    i managed to get chmod to work on the instalation of php on my computer (mac os x, apache, php 5) only if the user is www (safe mode is OFF) but i want this script to work on any computer of server, is there a function to find out who the php user is on that server? is there a way to find out what the current user is so the script can set the ownership back to normal after editing the file, i'm trying to make a simple script to edit and create files on my server online, any other suggestions how to do this?
    the script won't work at all on my host (linux, apache, php4) and i'm assuming this is also the problem, i'm a php newbie, so please be patiant with me .
    thanks in advance!

  2. #2
    SitePoint Member
    Join Date
    Apr 2005
    Location
    Nicosia, Cyprus
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can see name of the current user in php through $_ENV['LOGNAME'] and current group name is available through $_ENV['GROUP'].

  3. #3
    SitePoint Enthusiast LobsterMan's Avatar
    Join Date
    Apr 2005
    Location
    Jerusalem, Israel
    Posts
    94
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks, but does this give me the php username or the the un for a file? how do i use it?

  4. #4
    SitePoint Member
    Join Date
    Apr 2005
    Location
    Nicosia, Cyprus
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It gives you name of the user that runs webserver (usually apache or nobody).
    how do i use it?
    It depends on what you need 8) If you've got any problems with your scripts - post here your errors or any more information or I can't give you any help without it.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •