Im trying to open a txt file to write into it .

heres the warning : Warning: fopen(C:\inetpub\wwwroot\testFile.txt): failed to open stream: Permission denied in C:\inetpub\wwwroot\get.php

and heres the code

$fh = fopen("C:\inetpub\wwwroot\testFile.txt" , 'w');
fwrite($fh, "PHP");

what am I missing ?

Permission denied

For some reason you are not allowed to open that file for writing. What setup are you using?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.