Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I'm using fopen to read from a file

$fh = fopen($path, 'r') or die('Could not open file');

Now I contantly get error Could not open file. I checked the file path and even changed the permissions of the file to 777. Is there a way I can get a detailed error report as why the file can't be opened similar to mysql_error()?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
326 views
Welcome To Ask or Share your Answers For Others

1 Answer

Turn on error reporting, or, in a production environment (from PHP 5.2.0 onwards) you should also be able to use error_get_last().


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...