Probleme mit opendir

mydoys.de

Well-known member
ID: 84968
L
20 April 2006
2.758
125
Hi Leute ich habe ein Kleines Script erstellt was mit hilfe von der Webnummer und dem FTP Passwort sich auf dem FTP Account einloggt.

Der Login geht einwandfrei nur dann bekomme ich diese Fehlermeldung:


PHP:
Warning: opendir() [function.opendir]: open_basedir restriction in effect. File(/var/www/web31/html/) is not within the allowed path(s): (/var/www/web5/html/:/var/www/web5/phptmp/:/var/www/web5/files/:/var/www/web5/atd/) in /var/www/web5/html/ftp/upload.php on line 24

Dabei geht es hierum (Zeile3 ist bei mir die 24):
PHP:
function dirsize($dir) 
{
$dh = opendir($dir); $size = 0; while (($file = readdir($dh)) !== false) 
if ($file != "." and $file != "..") { $path = $dir."/".$file; 
if (is_dir($path)) $size += dirsize($path); elseif (is_file($path)) 
$size += filesize($path); } closedir($dh); return $size; }
$belegt= dirsize("$absolutpfad"); 
$last= $belegt / 1024/1000;
$zeige=round($last,2); 
$verz=opendir ("$absolutpfad");
echo "<center><b>Dein Verzeichnis</b> : <br><TABLE>";
while ($file = readdir ($verz)) {
if($file != "." && $file != "..")
}
closedir($verz);


PHP:
$absolutpfad="/var/www/$domain/html/";
$dir="/var/www/$domain/html/";

Wobei $domain meine Session webnummer ist.


Wer kann mir einen tipp geben?
Warum steht da einmal web31 und einmal web5 ?
Das Script "function dirsize($dir) " ist nicht von mir.
 
Du darfst auf das Verzeichnis von web5 zugreifen, das von web31 aber nicht.

Und naja, FTP hat nichts mit opendir() zu tun ;) Dann musste schon die FTP Funktionen für benutzen.
 
Du darfst auf das Verzeichnis von web5 zugreifen, das von web31 aber nicht.

Und naja, FTP hat nichts mit opendir() zu tun ;) Dann musste schon die FTP Funktionen für benutzen.

Jo die habe ich ja im Login..

PHP:
$conn_id = ftp_connect($ftp_host);
	@$login_result = ftp_login($conn_id, $benutzer, $passwort);

	if ((!$conn_id) || (!$login_result)) {
	echo "<font color=\"red\"><b>Fehler</b></font>";
	die;
	} else {
	@ftp_mkdir($conn_id,$domain);
	@ftp_site($conn_id,"chmod 777 $domain"); 
	}
	ftp_close($conn_id);