我想創建與文件創建777權限的.txt文件我用下面的代碼如何創建具有777權限的txtfile
if(file_exists($myFile) == true)
{
$err = "File Already Exist in The usrlogactity. Try Another Username";
}
else
{
$fh = fopen($myFile, 'w') or die("can't open file");
}
$文件=「usrlogactity/$ MYFILE」;
$ftp_server="02.79.103.130";
// set up basic connection
$conn_id = ftp_connect($ftp_server);
// login with username and password
$login_result = ftp_login($conn_id, "use1234", "pass123");
// try to chmod $file to 644
if (ftp_chmod($conn_id, 0777, $file) !== false)
{
//echo "$file chmoded successfully to 777\n";
}
else
{
//echo "could not chmod $file\n";
}
// close the connection
ftp_close($conn_id);
如果我執行這個代碼在服務器它創建具有644權限的文件,
但給人錯誤。如何創建包含777 permissiom .txt文件請指導我
的錯誤是
No such file or directory in usrlogactity/$myFile on line 13
我想你沒有權限創建文件...所以修復文件夾中的權限,然後確定你會創建 – 2011-02-24 10:44:49
你在PHP中運行'chmod'嗎? – 2011-02-24 10:45:20
嘆息 - *你得到了什麼*錯誤?請隨時附上具體的錯誤訊息 – 2011-02-24 10:46:16