0
我的系統:windos xp使用WAMP:在Windows上讀取文件權限
我已將所有用戶權限授予文件。
,但我無法讀取文件,但我得到的文件大小,
爲什麼這樣的事情發生,原因,我無法確定。
我該怎麼辦才能解決這個問題。
代碼
$fileName = "1.php";
if (floatval(phpversion()) >= 4.3) {
//loading data
$fileData = file_get_contents($fileName);
print(filesize($fileName));
} else {
//if file not exist then return -3
if (!file_exists($fileName)) {
eturn -3;
}
$fp = fopen($fileName, 'r');
// if file is not open in read mode then return -2
if (!$fp) return -2;
$fileData = '';
print(filesize($fileName));
//checking end of file
while(!feof($fp))
$fileData .= fgetc($fileName);
fclose($fp);
}
echo $fileData;
嘗試啓動WAMP的服務器管理員 – Parzifal 2012-01-08 17:21:26
首先的嘗試找出錯誤信息是什麼。 – hakre 2012-01-08 17:25:50
在這裏分享一些代碼 – 2012-01-08 17:27:12