GoldenGonaz
GoldenGonaz

Reputation: 1166

fopen() Permission denied

I have an issue that I cannot create any files using fopen.

I am using this as a test:

<?php
$myfile = fopen("testfile.txt", "w")
?>

and this error is output in NewRelic (and no testfile.txt is not created):

fopen(testfile.txt): failed to open stream: Permission denied

Upvotes: 0

Views: 4019

Answers (1)

user7181041
user7181041

Reputation:

It's because you don't have the right to open it. Make sure you have the right to write. If on linux you can use chmod() to set the the right of the file.

Upvotes: 1

Related Questions