我的VPS 2012 R2我有一个plesk配置和一个域当我试图创建和写入文本在txt文件,给了我错误我试过所有可能的方法来解决它我不能做plesk PHP上写文本到txt文件给出错误
我的PHP
<?php
$myfile = fopen("E:\Log\newfile.txt", "w") or die("Unable to open file! " . var_export(error_get_last(), true));
$txt = "Mickey Mouse\n";
fwrite($myfile, $txt);
$txt = "Minnie Mouse\n";
fwrite($myfile, $txt);
fclose($myfile);
?>
错误:
PHP Warning: fopen(): open_basedir restriction in effect. File(E:\Log
ewfile.txt) is not within the allowed path(s): (C:/Inetpub/vhosts/test.in\;C:\Windows\Temp\) in C:\Inetpub\vhosts\test.in\httpdocs\Test.php on line 2
PHP Warning: fopen(E:\Log
ewfile.txt): failed to open stream: Operation not permitted in C:\Inetpub\vhosts\test.in\httpdocs\Test.php on line 2
该文件夹处于完全许可仍然给我相同的错误 – Shaik
错误信息的哪部分你不明白? – symcbean