From the course: PHP for Web Designers
Unlock the full course today
Join today to access over 22,500 courses taught by industry experts or purchase this course individually.
What to do with "failed to open stream" - PHP Tutorial
From the course: PHP for Web Designers
What to do with "failed to open stream"
This pair of error messages frequently confuses beginners. The No such file or directory in this location on line 15, is particularly confusing. The file name being in bold type distracts attention from the important information which is in the first half of the error message. Failed to open stream, means the file couldn't be opened for one reason or another. And it doesn't refer to your web page but to the include file that's listed right at the beginning. In this case, it's require/includes/top.php. The second error message tells you the consequence of not being able to open the include file. It's a fatal error in this case because require was used. When require can't find an include file, it gives up attempting to display the rest of the page, and this reference to include_path is where PHP looks for include files by default. It's normally defined in the PHP configuration, and it can be tricky for beginners to change because the setup is slightly different depending on the server's…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
-
(Locked)
Dealing with PHP errors4m 15s
-
Why is my page blank or incomplete?3m 53s
-
(Locked)
Tracking down parse errors4m 32s
-
(Locked)
What to do with "failed to open stream"3m 22s
-
(Locked)
What does "headers already sent" mean?6m 18s
-
(Locked)
What does undefined index, variable, or constant mean?5m 52s
-
(Locked)
What on earth is T_ENCAPSED_AND_WHITESPACE?1m 59s
-
(Locked)
-