Reputation: 11768
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, [email protected] 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 ?
Upvotes: 1
Views: 1978
Reputation: 2825
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.
Upvotes: 4