failed to open stream

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
hame22
Forum Contributor
Posts: 214
Joined: Wed May 11, 2005 5:50 am

failed to open stream

Post by hame22 »

Hi

everynow and again my site experiences the following error:

Warning: main(db_functions.php): failed to open stream: No such file or directory

before you say it the file is in the right directory and 99% of the time the all pages of the site work perfectly.

However what I want to no is the reason behind this 1% error message

any ideas?

alex
sticksys
Forum Commoner
Posts: 33
Joined: Thu Aug 18, 2005 3:23 am
Location: Isreal
Contact:

Post by sticksys »

some include or require have wrong url....
hame22
Forum Contributor
Posts: 214
Joined: Wed May 11, 2005 5:50 am

Post by hame22 »

this is not the problem, all url's are correct, if you read the web pages work 99% of the time

I can use all the web pages features for a week with no problem and then out of the blue I am displayed this error which can be cleared by refreashing the page again

any ideas how to fix the problem
Sander
Forum Commoner
Posts: 38
Joined: Sat Aug 06, 2005 12:43 pm

Post by Sander »

Maybe someone else is uploading an update of that file exactly at the time you visit (Yeah... rather unlikely).
hame22
Forum Contributor
Posts: 214
Joined: Wed May 11, 2005 5:50 am

Post by hame22 »

nope as I am the web developer!!

:wink:
User avatar
raghavan20
DevNet Resident
Posts: 1451
Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:

Post by raghavan20 »

can you give the code of your include or require statement.
i think u use a include, thats why there is a warning.
may be you can show snippets of code for the two files. :roll:
Last edited by raghavan20 on Fri Aug 19, 2005 6:16 am, edited 1 time in total.
hame22
Forum Contributor
Posts: 214
Joined: Wed May 11, 2005 5:50 am

Post by hame22 »

Code: Select all

include_once('../includes/db_functions.php');
include_once('../includes/search_functions.php');
include_once('../includes/cat_functions.php');
include_once('../includes/user_auth_functions.php');
User avatar
raghavan20
DevNet Resident
Posts: 1451
Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:

Post by raghavan20 »

i think before the include statements you can try
file_exists($filename) and is_readable($filename)
hame22
Forum Contributor
Posts: 214
Joined: Wed May 11, 2005 5:50 am

Post by hame22 »

yeah bt that will only mask the error not fix it
Post Reply