Reply to Re: PHP/IIS: File Read/Write OK, File Unlink Denied

Your name:

Reply:


Posted by Kimmo Laine on 03/22/06 12:35

<lorenzogordon@hotmail.com> wrote in message
news:1143022232.809686.208670@i39g2000cwa.googlegroups.com...
> Hi there,
>
> I'd greatly appreciate any insights into the following problem:
>
> I've got PHP running fine on IIS (OS: Server 2003, SP1; IIS: 6.0; PHP:
> 4.3.11).
>
> In PHP, the user uploads a file, which is then processed and the
> contents are inserted into a new file, created in PHP, onto the server.
>
> This bit works fine, the new file created by PHP is correctly stored.
>
> Later, once the user confirms the upload and PHP inserts the contents
> of the file into the DB, the code tries to remove the file created in
> PHP moments earlier, via the unlink() function.
>
> What I see on screen is the following: Permission denied
>
> I have made sure that the permissions for the Internet account that
> created (and is trying to delete) the file have full permissions over
> this particular folder and the files within it. But the user must have
> permission anyway, because they are able to create this file in the
> first place.
>
> I've looked at the permissions for the file in PHP, which read: 0666.
> So everthing *appears* ok to me; I can't see where the permission issue
> is coming from.
>
> Anyone got any ideas?


This is just a wild guess, but if you open the file with fopen, for example,
and then leave it open without fclose, and while the file is open you try to
unlink it, the file is concidered unremovable because it's in use by php.
Could something like this be the reason?

--
"En ole paha ihminen, mutta omenat ovat elinkeinoni." -Perttu Sirviφ
spam@outolempi.net | Gedoon-S @ IRCnet | rot13(xvzzb@bhgbyrzcv.arg)

[Back to original message]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация