Find the answer to your Linux question:
Results 1 to 4 of 4
Cheers all, I would like to create my own log file and write to it using some linux system vars. I know how to create and write to a file ...
  1. #1
    Just Joined!
    Join Date
    Apr 2008
    Posts
    8

    Write to a log file with PHP

    Cheers all,
    I would like to create my own log file and write to it using some linux system vars. I know how to create and write to a file with PHP, but I do not know how to capture or get the values from system variables like date, who, pwd, etc.

    Is there a way to get these values in a php script?

    Thanks for any tips...
    JohnC

  2. #2
    Linux Enthusiast meton_magis's Avatar
    Join Date
    Oct 2006
    Location
    arizona
    Posts
    665
    Quote Originally Posted by johncowan View Post
    Cheers all,
    I would like to create my own log file and write to it using some linux system vars. I know how to create and write to a file with PHP, but I do not know how to capture or get the values from system variables like date, who, pwd, etc.

    Is there a way to get these values in a php script?

    Thanks for any tips...
    JohnC
    PHP: shell_exec - Manual
    New to the internet, technical forums, or the hacker / open source community??
    Read this to learn good posting habits http://www.catb.org/~esr/faqs/smart-questions.html

    RHCE for RHEL version 5
    RHCT for RHEL version 4

  3. #3
    Just Joined!
    Join Date
    Apr 2008
    Posts
    8
    Eight years in PHP and I never knew that command was around.

    Most excellent! Thank you!

    Cheers!

  4. #4
    Linux Enthusiast meton_magis's Avatar
    Join Date
    Oct 2006
    Location
    arizona
    Posts
    665
    You are welcome
    New to the internet, technical forums, or the hacker / open source community??
    Read this to learn good posting habits http://www.catb.org/~esr/faqs/smart-questions.html

    RHCE for RHEL version 5
    RHCT for RHEL version 4

Posting Permissions

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