You are here: Re: rename(old file, new file) function Permission Denied « All PHP « IT news, forums, messages
Re: rename(old file, new file) function Permission Denied

Posted by chris on 11/18/05 08:14

unfortunatly i dont have root access to install any other modules

--
Όα
"Michael Vilain" <vilain@spamcop.net> wrote in message
news:vilain-7228F7.18154317112005@comcast.dca.giganews.com...
> In article <ops0eo8y1or1c5ad@lancer>, Berimor <berimor@berimor.ber>
> wrote:
>
>> On Thu, 17 Nov 2005 23:57:58 +0800, chris <someone@here.com> wrote:
>>
>> > im trying to rename a file using the rename(old file, new file)
>> > function
>> >
>> > i have also tried the copy funtion also
>> >
>> > the folder that the files are in are chmod 755
>> > and the files themself are chmod 644
>> >
>> > if i run the script on my own domain it works as expected
>> >
>> > however i am trying to run it on another domain on another server, the
>> > files and directory have the same permissions as mentioned above but i
>> > get a
>> > PHP Permission denied warning.
>> >
>> > my domain is running php 5.
>> > the problem domain is running PHP 4.3.11
>> >
>> > any idea why this is not working
>> >
>>
>>
>>
>> The problem is in Apache + general system configuration. The PHP
>> interpretator by itself (or module - if installed as part of Apache )
>> doesnt have enough rights to make such manipulations with file system. I
>> have some domains with the same problem and tech guys usually says - we
>> made this because of security reason. But i think that they are not
>> expirienced enough and are not sure - that's why cosiders this as the
>> best
>> way to defend themselves from probable hacks.
>
> If the code that's doing the rename is running as an Apache module
> mod_php, then the process that's doing the rename is likely the Apache
> process. It's probably running as nobody or www or apache. It may not
> have write permissions to write into the directory where the newfile is
> being placed.
>
> To get around this, run php as a CGI script with the CGIwrap wrapper:
>
> http://cgiwrap.sourceforge.net/
>
> This will force the child process running the php code to run as a
> specific user ID. It also requires that php be built as a command line
> utility.
>
> --
> DeeDee, don't press that button! DeeDee! NO! Dee...
>
>
>

 

Navigation:

[Reply to this 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

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