Professional Web Applications Themes

permission error on unlink, but who has permission if not PHP? - PHP Development

I wrote some code that let me upload a file to my server. Then I wrote some code to let me delete the file. But when I try to delete, I get this error: Warning: Unlink failed (Permission denied) in /usr/local/www/vhosts/publicdomainsoftware.org/htdocs/ppUtilityCode/mcAdminImages.php on line 254 I don't get it. If PHP uploads the file, how can PHP not have the permission to delete it?...

  1. #1

    Default permission error on unlink, but who has permission if not PHP?

    I wrote some code that let me upload a file to my server. Then I wrote
    some code to let me delete the file. But when I try to delete, I get
    this error:

    Warning: Unlink failed (Permission denied) in
    /usr/local/www/vhosts/publicdomainsoftware.org/htdocs/ppUtilityCode/mcAdminImages.php
    on line 254


    I don't get it. If PHP uploads the file, how can PHP not have the
    permission to delete it?
    lawrence Guest

  2. #2

    Default Re: permission error on unlink, but who has permission if not PHP?

    "lawrence" a écrit le 17/11/2003 :
    > I wrote some code that let me upload a file to my server. Then I wrote
    > some code to let me delete the file. But when I try to delete, I get
    > this error:
    >
    > Warning: Unlink failed (Permission denied) in
    > /usr/local/www/vhosts/publicdomainsoftware.org/htdocs/ppUtilityCode/mcAdminImages.php
    > on line 254
    >
    >
    > I don't get it. If PHP uploads the file, how can PHP not have the
    > permission to delete it?
    Change the rights with chmod(777) before deleting.


    Jedi121 Guest

  3. #3

    Default Re: permission error on unlink, but who has permission if not PHP?

    Jedi121 wrote:

    >> I don't get it. If PHP uploads the file, how can PHP not have the
    >> permission to delete it?
    >
    > Change the rights with chmod(777) before deleting.
    Also, output the name of the file you're trying to delete, so that
    you can make sure it's really what you think it is...

    It may be that you're trying to delete a directory that the webserver
    process doesn't own, etc,
    Matty Guest

  4. #4

    Default Re: permission error on unlink, but who has permission if not PHP?

    [email]lkrubnergeocities.com[/email] (lawrence) wrote in message news:<da7e68e8.0311171149.7aa010cbposting.google. com>...
    > I wrote some code that let me upload a file to my server. Then I wrote
    > some code to let me delete the file. But when I try to delete, I get
    > this error:
    >
    > Warning: Unlink failed (Permission denied) in
    > /usr/local/www/vhosts/publicdomainsoftware.org/htdocs/ppUtilityCode/mcAdminImages.php
    > on line 254
    >
    >
    > I don't get it. If PHP uploads the file, how can PHP not have the
    > permission to delete it?
    If the file name you uploaded already existed on the web server and
    the web server user (apache?) has write permissions to the file, it
    will be allowed.

    To unlink, the web server user must have write permissions to the
    directory.

    Conversely, if a user has write permissions to a directory, it may
    delete files from that directory regardless of who owns them...

    Hope this helps,

    Kevin
    Kevin Collins Guest

  5. #5

    Default Re: permission error on unlink, but who has permission if not PHP?

    [email]lkrubnergeocities.com[/email] (lawrence) wrote in message news:<da7e68e8.0311171149.7aa010cbposting.google. com>...
    > I wrote some code that let me upload a file to my server. Then I wrote
    > some code to let me delete the file. But when I try to delete, I get
    > this error:
    >
    > Warning: Unlink failed (Permission denied) in
    > /usr/local/www/vhosts/publicdomainsoftware.org/htdocs/ppUtilityCode/mcAdminImages.php
    > on line 254
    >
    >
    > I don't get it. If PHP uploads the file, how can PHP not have the
    > permission to delete it?
    Well, okay, what I get from this debate is that the first place I
    should look for trouble is to make sure the code is trying to delete
    the same file I think I specified. I appreciate feedback that tells
    where to look for me trouble, so thanks.
    lawrence Guest

Similar Threads

  1. 550 Access is denied - permission error
    By aron_palmer in forum Macromedia Contribute Connection Administrtion
    Replies: 0
    Last Post: January 4th, 04:14 AM
  2. permission error from opened PDF doent
    By Mina_Vaghela@adobeforums.com in forum Adobe Acrobat Windows
    Replies: 0
    Last Post: May 3rd, 06:59 PM
  3. fastcgi permission error
    By Carl Youngblood in forum Ruby
    Replies: 7
    Last Post: September 30th, 10:46 PM
  4. flock() Permission denied error
    By Marc in forum PHP Development
    Replies: 0
    Last Post: September 4th, 03:45 PM
  5. Permission denied error
    By zbob in forum ASP
    Replies: 0
    Last Post: July 18th, 11:17 AM

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
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139