我在一个更大的脚本里面有一个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.
更多推荐
发布评论