File::read() reads a specific amount of bytes from a specified file and returns them to the user.
Parameter
string $filename - the file to read from
int $size - the number of bytes to read from the file (defaults to FILE_DEFAULT_READSIZE)
mixed $lock - lock type to use, FALSE if none
Return value
mixed - this function returns the requested bytes from the file if there were no errors, FALSE if it reached EOF or a PEAR_Error object if an error has occured during reading from file.
Check if the path that is passed to the function is correct.
NULL
"Failed to open file: $filename"
There are few possible things that might cause that error, usually it's caused by wrong permissions or bad sectors on the harddisk.
Check the permissions of the file (ls -l {file} on UNIX systems) and change them so the file is readable by PHP, check if the harddisk is working properly and has no bad sectors.
Deliver First Class Web Sites: 101 Essential Checklists Want to learn how to make your web sites usable and accessible? Want to ensure that your sites meet current best practice, without spending hours trawling through incomprehensible specifications and recommendations from dozens of different books, research papers, and web sites? Want to make sure that the sites you build are "right the first time," requiring no costly redevelopments?