简体   繁体   English

fopen()权限被拒绝

[英]fopen() Permission denied

I have an issue that I cannot create any files using fopen. 我有一个问题,我无法使用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): 并且此错误在NewRelic中输出(并且未创建testfile.txt):

fopen(testfile.txt): failed to open stream: Permission denied fopen(testfile.txt):无法打开流:权限被拒绝

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. 如果在Linux上,则可以使用chmod()设置文件的权限。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM