Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: File Permission

  1. #1
    Join Date
    Apr 2014
    Beans
    8

    File Permission

    Hello,

    I Coded a file which create new file on the same folder running on localhost ( the php file)

    but the probleme that there is no created file on the folder ! i tried with permission but with no result ..

    give me you ideals


  2. #2
    Join Date
    Apr 2014
    Beans
    8

    Re: File Permission

    up up up

  3. #3
    Join Date
    Jul 2008
    Location
    The Left Coast of the USA
    Beans
    Hidden!
    Distro
    Kubuntu

    Re: File Permission

    Please wait 24 hours before bumping a thread.

    When you do so, please be somewhat less insistent.

    This is a forum populated by volunteers.
    Please read The Forum Rules and The Forum Posting Guidelines

    A thing discovered and kept to oneself must be discovered time and again by others. A thing discovered and shared with others need be discovered only the once.
    This universe is crazy. I'm going back to my own.

  4. #4
    Join Date
    Jan 2008
    Location
    Manchester UK
    Beans
    13,573
    Distro
    Ubuntu

    Re: File Permission

    Quote Originally Posted by Dz_NiT0 View Post
    up up up
    down down down

  5. #5
    Join Date
    Jul 2013
    Location
    San Francisco
    Beans
    36

    Re: File Permission

    Sorry, but your comment is not very specific. You created a script? (php script?) which you put somewhere (where?) and attempt to execute the php how?

  6. #6
    Join Date
    Apr 2014
    Beans
    8

    Re: File Permission

    Quote Originally Posted by davea42 View Post
    Sorry, but your comment is not very specific. You created a script? (php script?) which you put somewhere (where?) and attempt to execute the php how?
    well ,

    I have a php script which content the "fopen;fwrite" functions but when i run it on localhost there is no created file which is supposed to be :/

  7. #7
    Join Date
    Jan 2006
    Location
    Not heaven... Iowa
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: File Permission

    Perhaps you could post the code...
    Linux User #415691 Ubuntu User #8629
    Iowa Team (LoCo): [Wiki] [Launchpad]
    IRC channel: #ubuntu-us-ia on irc.freenode.net

  8. #8
    Join Date
    Apr 2014
    Beans
    8

    Re: File Permission

    the php script :
    PHP Code:
    <?php

    $content 
    "some text here";
    $fp fopen("myText.txt","wb");
    fwrite($fp,$content);
    fclose($fp);

    ?>
    when i run it on the localhost it's supposed to create a file named "myText.txt" in the same patch , but there is not

    PS : i use ubuntu 12.04

  9. #9
    Join Date
    Apr 2014
    Beans
    8

    Re: File Permission

    i tried to change the patch permission and nothing happend the sema with the file :/

  10. #10
    Join Date
    Nov 2008
    Location
    Boston MetroWest
    Beans
    16,326

    Re: File Permission

    If you're running the script through localhost, I assume you are using a web server like Apache.

    The server runs with the permissions of the user www-data, which has no permission to write files anywhere outside /tmp.

    Enter a full file path in fopen(), like "/tmp/myTest.txt" and see if that works. /tmp can be written to by any user. If that works, then you need to decide where you want these files stored and grant write permissions to the www-data to that directory.

    Also, you should always check the contents of /var/log/apache2/error.log to see if something went wrong.
    Last edited by SeijiSensei; April 19th, 2014 at 12:27 PM.
    If you ask for help, do not abandon your request. Please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

Page 1 of 2 12 LastLast

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
  •