Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: [function.move-uploaded-file]: failed to open stream: Permission denied in

  1. #11
    Join Date
    Jul 2007
    Beans
    48

    Re: [function.move-uploaded-file]: failed to open stream: Permission denied in

    Wow, this thread just keeps on living!

    You have Windows permissions issues. Allow your web user (exact name will be listed under local users and groups) read/write access to c:/windows/temp and c:/inetpub.

  2. #12
    Join Date
    Mar 2011
    Beans
    1

    Re: [function.move-uploaded-file]: failed to open stream: Permission denied in

    By the way is there any permission security software in ubuntu (e.g. i'm using Fedora 14 so in my case it's called "SELINUX"). If your ubuntu version has similar application then i think you should configure it.

    I have the same problem in Fedora 14 and in my case, i just need to turn the SELINUX "Off" of change it to the "Permissive" mode. The tutorial can be seen in http://fedora-denilugito.blogspot.com/

  3. #13
    Join Date
    Jun 2011
    Beans
    2

    Re: [function.move-uploaded-file]: failed to open stream: Permission denied in

    It's good that you have the function that stops php files from being uploaded, smart move. However, you're going to have to be very careful with your permissions on the folder you're uploading files to. If you are using a database on that site with access to that folder, then I want to stress that you should include checks for other files, especially .sql files or .cgi files ( you may not have cgi enabled), we do this to prevent execution of scripts and the like.

    As to the permissions problem, the folder you are trying to write to needs to be owned by same user that apache (webserver) is executed as. Usually, at large hosting sites, that would be your username - it will be chroot jailed so your site is only affected by your code, and your code cant affect another site.

    I suggest a permissions scheme of 0644 on the folder - on the server - you wish to upload to. The exact command is 'chmod 0644 yourdirectory' If you're using a gui to change permissions such as in filezilla or wsftp, then you would tick the boxes for owner to write and read, but not execute. All others (group and other) are read only.

    I hope this helps with your problems, and happy coding.

    x.algorithm

  4. #14
    Join Date
    Mar 2012
    Beans
    1

    Re: [function.move-uploaded-file]: failed to open stream: Permission denied in

    Please change the following line of code:
    $target = $currentdir . "/upload/";

    to:
    $target = $currentdir . "/upload";

    I was having a similar problem and was able to solve using this alteration.

    Regards.

Page 2 of 2 FirstFirst 12

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
  •