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

Ask a Question related to PHP Development, Design and Development.

  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. Similar Questions and Discussions

    1. 550 Access is denied - permission error
      hi all. im having an issue tring to connect to a site using contribute 3.11. i get this error. Make Directory Test: The server is unable to...
    2. permission error from opened PDF document
      I have a program written in asp which would view a scanned pdf document and delete it after coping to other folder. It use to work fine until I...
    3. fastcgi permission error
      Hello, I'm trying to set up ruby-fastcgi on redhat 9. Everything seems to be set up right, but I get an error in my apache logs when I try to...
    4. flock() Permission denied error
      Hello, when using flock() I get a permission denied error: Warning: fopen("<filename>", "r+") - Permission denied in <pathtofile> on line 7 I...
    5. Permission denied error
      Hello I have the following configuration: - Windows 2000 Adv Server - IIS is running on this machine - I have some ASP scripts and a global.asa...
  3. #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

  4. #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

  5. #4

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

    [email]lkrubner@geocities.com[/email] (lawrence) wrote in message news:<da7e68e8.0311171149.7aa010cb@posting.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

  6. #5

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

    [email]lkrubner@geocities.com[/email] (lawrence) wrote in message news:<da7e68e8.0311171149.7aa010cb@posting.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

Posting Permissions

  • You may not post new threads
  • You may 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