Article View: pl.comp.lang.php
Article #220471Rename + open_basedir restriction
From: Ja
Date: Tue, 08 Sep 2009 11:58
Date: Tue, 08 Sep 2009 11:58
29 lines
1373 bytes
1373 bytes
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?
Technical Details
Message-ID:
<h85gt8$j3a$1@news.onet.pl>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!newsfeed.gazeta.pl!news.onet.pl!not-for-mailShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!newsfeed.gazeta.pl!news.onet.pl!not-for-mail From: Ja <fm24@poczta.onet.pl> Newsgroups: pl.comp.lang.php Subject: Rename + open_basedir restriction Date: Tue, 08 Sep 2009 13:58:23 +0200 Organization: http://onet.pl Lines: 29 Message-ID: <h85gt8$j3a$1@news.onet.pl> NNTP-Posting-Host: 188.33.33.235 Mime-Version: 1.0 X-Trace: news.onet.pl 1252411114 19562 188.33.33.235 (8 Sep 2009 11:58:34 GMT) X-Complaints-To: niusy@onet.pl NNTP-Posting-Date: Tue, 8 Sep 2009 11:58:34 +0000 (UTC) User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit