Forum Moderators: coopster

Message Too Old, No Replies

Warning: main(.. bala bala failed to open stream: No such file or dire

It's there I know it is!

         

Gruessle

2:37 am on Mar 18, 2005 (gmt 0)

10+ Year Member



I did a search on this and it looks like half of the iNet has it. Well maybe not half but ...

Well here it is.
I am starting up with follwing two lines of code and have nothing else on the page the db_Funftion.php gives me an error like the one below for no good reason. Both files are there in the same directory. If I change the order function.php will still work but db_Funftion.php will not. I have not changed anything in that file and it used to work. If I take the content from db_Funftion.php and copy it in to my calling file the code works just fine. What is going on?

include ('../inc/function.php');
include ('../db_Funftion.php');

Warning: main(../inc/function.php): failed to open stream: No such file or directory in /var/www/docs/archives/docs.php on line 1

Warning: main(): Failed opening '../inc/function.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/docs/archives/docs.php on line 1

[edited by: coopster at 11:32 am (utc) on Mar. 18, 2005]
[edit reason] removed url [/edit]

Gruessle

2:46 am on Mar 18, 2005 (gmt 0)

10+ Year Member



Made some misstakes in spelling here it is called db_Function.php not db_Funftion.php

And below the error comes from db_Function.php not from function.php - that would have been too easy, maybe not maybe it is that easy, we will see - who knows.

Sorry & Thanx

ironik

3:20 am on Mar 18, 2005 (gmt 0)

10+ Year Member



Without being able to look at the directory structure, I'd suggest you try:

include ($_SERVER['DOCUMENT_ROOT'] . 'inc/function.php');

(if the inc folder is in your servers document root directory)

It should work as is though. I think using document root might open up an additional path disclosure vulnerability... not sure on that one. I'm a little uncertain of this, but I think document root also on a windows file system returns a structure that will be incompatible with the forward slash type structure...

try it anyway, see how it goes...

Gruessle

4:36 am on Mar 18, 2005 (gmt 0)

10+ Year Member



Here is the code
include ($_SERVER['DOCUMENT_ROOT'] . 'inc/db_function.php');
//include ('../inc/function.php');
//include ('../db_Function.php');

Here is my error and file structure ae well. This looks like a bug doesn't it?

Warning: main(/var/www/inc/db_function.php): failed to open stream: No such file or directory in /var/www/test/test2.php on line 3

Warning: main(): Failed opening '/var/www/inc/db_function.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/test/test2.php on line 3
Functions Include OK

Fatal error: Call to undefined function: selectquery() in /var/www/test/test2.php on line 7

Gruessle

4:46 am on Mar 18, 2005 (gmt 0)

10+ Year Member



I changed the name from
db_Function.php
to
db.php

And it works now!

?