PHP - open txt file with SSH

Discussion in 'PHP' started by Helado, Sep 6, 2009.

  1. #1
    Hey, basically I want to run a PHP file in SSH. I know how to do it, php /var/to/file.php... but the thing is, in this PHP script I have a txt file that I want the PHP to open - when running the PHP script on apache it can find the file... but with SSH it can't...

    The file is located in the same place as the script, and whatever path I put it (/ or /var/www/html) it can't find it!

    Any help?

    Thanks.

    EDIT: nevermind I have done it... it worked with /var/www/html, but last time it didn't. O.O
     
    Last edited: Sep 6, 2009
    Helado, Sep 6, 2009 IP
  2. hip_hop_x

    hip_hop_x Active Member

    Messages:
    522
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    90
    #2
    or from php you can do this
    file_get_contents("file.txt",true);
    Code (markup):
     
    hip_hop_x, Sep 7, 2009 IP