Fedora File Manager access

Discussion in 'PHP' started by dcole07, May 22, 2006.

  1. #1
    What would the script be for creating a blank file on a Fedora Core 5 system. I was on windows and everything work but now I'm on a Linux OS, and someone said to add chmod but it didn't work... I also tried the other changes to the dir. and with group and owner. Can someone show me a correct script?
     
    dcole07, May 22, 2006 IP
  2. clancey

    clancey Peon

    Messages:
    1,099
    Likes Received:
    63
    Best Answers:
    0
    Trophy Points:
    0
    #2
    chmod is used to change permission, not to create files.

    From the command line, you can create an empty file by typing:
    echo "" > test.file
    Code (markup):
    In order to create a file from within php, the webserver needs to have write permission. In a directory in a safe location you would allow the world to write to the directory. You php program would then need to contain code to create a file:

    
    <?php
    $handle = fopen("/home/myfolder/test.file", "x");
    ?> 
    
    Code (markup):
     
    clancey, May 22, 2006 IP