🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.php
Article #220472

Re: Rename + open_basedir restriction

#220472
From: Lemat
Date: Tue, 08 Sep 2009 12:01
40 lines
1928 bytes
Ja wrote:

> Witam!
> 
> Mam taki skrypt:
> 
> <?
> $string="";
> $fileCount=0;
> $filePath=$PATH.'/home/a68848/public_html/g/';
> $dir = opendir($filePath);
> while ($file = readdir($dir)) {
>    if (eregi("\.zip",$file)) {
>      $string .= "$file";
>      $fileCount++;
>    }
> }
> if ($fileCount > 0) {
> $search = array('%5B', '%5D', '%20');
> $replace = array('[', ']', ' ');
> $subject = $string;
> 
> $new_name = str_replace($search, $replace, $subject);
> rename($string, $new_name);
> }
> ?>
> 
> Skrypt zwraca błąd "Warning: rename() [function.rename]: open_basedir
> restriction in effect...", ale jak miejsce $string, $new_name wstawię
> gołe nazwy plików (bez żadnych ścieżek to nazwy się zmieniają.
> Wie ktoś, gdzie tkwi błąd?

nie ma żadnego błędu, jest to prawidłowe zachowanie PHP

-- 
Pozdrawiam
Lemat
easyISP jest spam friendly - utrzymuje notorycznego spamera polandexport / 
ipeik / netex-sterling, pomóżcie ich przekonać nie wykupując u nich 
hostingu. 
Technical Details
Message-ID: <h85h64$fsp$1@atlantis.news.neostrada.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!newsfeed.pionier.net.pl!news.nask.pl!news.nask.org.pl!plix.pl!newsfeed1.plix.pl!wsisiz.edu.pl!newsfeed.neostrada.pl!atlantis.news.neostrada.pl!news.neostrada.pl!not-for-mail
References: <h85gt8$j3a$1@news.onet.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!newsfeed.pionier.net.pl!news.nask.pl!news.nask.org.pl!plix.pl!newsfeed1.plix.pl!wsisiz.edu.pl!newsfeed.neostrada.pl!atlantis.news.neostrada.pl!news.neostrada.pl!not-for-mail
From: Lemat <#@lemat.priv.pl>
Newsgroups: pl.comp.lang.php
Subject: Re: Rename + open_basedir restriction
Followup-To: pl.comp.lang.php
Date: Tue, 08 Sep 2009 14:01:04 +0200
Organization: lemat.priv.pl
Lines: 40
Message-ID: <h85h64$fsp$1@atlantis.news.neostrada.pl>
References: <h85gt8$j3a$1@news.onet.pl>
NNTP-Posting-Host: elf.lemat.priv.pl
Mime-Version: 1.0
X-Trace: atlantis.news.neostrada.pl 1252411396 16281 79.190.106.115 (8 Sep 2009 12:03:16 GMT)
X-Complaints-To: usenet@news.neostrada.pl
NNTP-Posting-Date: Tue, 8 Sep 2009 12:03:16 +0000 (UTC)
User-Agent: KNode/4.3.1
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit