fopen()失败了。(fopen() fails . Is it the server?)

编程入门 行业动态 更新时间:2024-10-22 13:58:29
fopen()失败了。(fopen() fails . Is it the server?)

我在一个更大的脚本里面有一个fopen()函数的问题,所以我提取了一个打开文件的简单例程我用它:

<?php $fh = fopen("users.txt","r"); if ($fh) { echo "File opened"; } else echo "Unable to open file"; ?>

该文件存在于相同的路径,如php文件,但服务器显示以下页面:

服务器遇到内部错误或配置错误,无法完成您的请求。

请与服务器管理员webmaster @ .... com联系,告知他们错误发生的时间,以及可能导致错误的任何操作。

服务器错误日志中可能提供了有关此错误的更多信息。

此外,尝试使用ErrorDocument处理请求时遇到404 Not Found错误。

可能是这个问题的根源是什么?

I have a problem with fopen() function inside a bigger script so i extracted a simple routine that opens a file i use this :

<?php $fh = fopen("users.txt","r"); if ($fh) { echo "File opened"; } else echo "Unable to open file"; ?>

The file exists is in the same path such as the php file but the server displays the following page:

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@....com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

What could be the source of this problem ?

最满意答案

文件权限是777所以我不认为这是一个问题

具有讽刺意味的是。

文件“/home/add_device.php”可由其他人写“

将它们设置为755。

The file permissions are 777 so i don't think it is a problem

Ironically, it is.

File "/home/add_device.php" is writeable by others"

Set them to 755.

更多推荐

本文发布于:2023-07-16 07:36:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1125483.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:失败了   fopen   server   fails

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!