Czytanie plików z PHP - fopen / fread
<?php
$top = "../top.txt";
$middle = "../middle.txt";
$bottom = "../bottom.txt";
$end = "/st.txt";
$data = "/dt.txt";
$handle1 = fopen($top, "r");
$contents1 = fread($handle1, filesize($top));
fclose($handle1);
$handle2 = fopen($end, "r");
$contents2 = fread($handle2, filesize($end));
fclose($handle2);
$handle3 = fopen($middle, "r");
$contents3 = fread($handle3, filesize($middle));
fclose($handle3);
$handle4 = fopen($data, "r");
$contents4 = fread($handle4, filesize($data));
fclose($handle4);
$handle5 = fopen($bottom, "r");
$contents5 = fread($handle5, filesize($bottom));
fclose($handle5);
echo $contents1;
echo $contents2;
echo $contents3;
echo $contents4;
echo $contents5;
?>
Dostaję te błędy dla każdego z nich:
Ostrzeżenie: fopen (../ top.txt) [function.fopen]: nie udało się otworzyć strumienia: brak takiego pliku lub katalogu
Ostrzeżenie: filesize () [function.filesize]: stat nie powiódł się dla ../top.txt
Ostrzeżenie: fread (): argument podany nie jest prawidłowym zasobem strumienia
Ostrzeżenie: fclose (): podany argument nie jest prawidłowym zasobem strumienia
CHMOD we wszystkich plikach i folderach i jest ustawiony na 777
Wszystkie pliki istnieją na serwerze
PHP5 jest zainstalowany na serwerze
Co ja robię źle?