SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    May 2008
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP scripts run as a user on the server - How do I find out what this user is?

    Hi Everyone!

    I have a simple question that has arisen from my studies into implementing basic security measures with PHP.

    How do I know what 'user' the scripts are running as on the server?

    I understand it is often user 'nobody' on some systems, not on mine though I don't think.

    Anyway sorry it's probably really a beginners question but I am just that!

    In case you are wondering I need to know so I can store an encryption key somewhere so that user can access it.

    Thanks to all.

  2. #2
    Team SitePoint santouras's Avatar
    Join Date
    Jul 2006
    Location
    planet earth
    Posts
    276
    Mentioned
    13 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:

    echo exec('whoami'); 
    my utility belt tells me its to the bar batman

    read the manual then google it then do a search THEN post....

  3. #3
    SitePoint Member
    Join Date
    May 2008
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks,

    That returns "www". I'm running PHP and Apache on Mac OS 10.4.

    I found a Terminal utility that can list all the users on a machine: the directory service command line utility...

    dscl . list /users

    In fact it shows that there is a user called 'nobody' on my system as well!

    I will try putting the encryption keyring where 'www' can access it.

    Thanks.


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
  •