PHP不将文本写入txt文件Windows Server 2012 R2

I am trying to add text to txt file via php in new production server that is not inserting if the same am trying on my local machine that happens and i have given all permission to the folder in server though that is not saving this sound funny i tried all possible ways that google says still not working

    <?php
$myfile = fopen("newfile.txt", "w") or die("Unable to open file! " . var_export(error_get_last(), true));
$txt = "Mickey Mouse
";
fwrite($myfile, $txt);
$txt = "Minnie Mouse
";
fwrite($myfile, $txt);
fclose($myfile);
?>

output error with in the directory

   PHP Warning:  fopen(newfile.txt): failed to open stream: Permission denied in C:\Inetpub\vhosts\test.in\httpdocs\Test.php on line 2

error for different drive

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

There are a number of reasons why your PHP script might not be able to write to the filesystem. The most common one is a permissions issue: the user that your Web server runs as does not have permission to write to the directory in question.

Another reason why you might not be able to write to files is that some service providers in my experience disable file I/O functions in the php.ini file using the disable_functions directive. You would have to get the administrator of the server to change this for you.