[英]How can I write a file from one server to another server in php?
是否可以將服務器上的文件寫入另一台服務器?
我有2個域都在不同的Web服務器上
http://example1.com在godady上 , http://example2.com在免費的webhost eu5.org上 ,
我想從http://example2.com寫http://example1.com的 htaccess文件。
我在example2.com中的代碼
$code =$_POST["cd"];
if (empty($code)) {
echo "Could not insert data!";
} else {
$file = fopen("http://server2.com/.htaccess", "w");
echo fwrite($file, $code);
fclose($file);
}
它沒有重寫.htaccess文件,也沒有php錯誤。 example1 / .htaccess的文件permision是777。
任何想法?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.