www.webdeveloper.com
Results 1 to 3 of 3

Thread: accessing Linux content from PHP

Hybrid View

  1. #1
    Join Date
    Apr 2012
    Posts
    99

    accessing Linux content from PHP

    I have this code, but it says it is not able to open it:

    $myFile = "/home/user/Desktop/webapp.log";
    $fh = fopen($myFile, 'a') or die("can't open file");
    $stringData = "Stuff";
    fwrite($fh, $stringData);
    fclose($fh);

  2. #2
    Join Date
    Mar 2009
    Posts
    452
    check if this files really exists and php has permission to read/write to that file

  3. #3
    Join Date
    Apr 2012
    Posts
    99
    On my Linux machine, it is set to:
    -rw-r--r--

    I changed it to 777 for chmod, and can now access it.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles