Page 1 of 1

Warning: Failed to open stream

Posted: Fri Sep 25, 2009 1:01 am
by phphunger
Hi,

Can anyone solve the problem of mine. When i run my script the folowing error persists..

Code: Select all

Warning: include(../dbconfig.php) [function.include]: failed to open stream: No such file or directory in C:\xampp\htdocs\SuperFastSMS\Clients\QuickSMS.php on line 41
 
Warning: include() [function.include]: Failed opening '../dbconfig.php' for inclusion (include_path='.;C:\xampp\php\pear\') in C:\xampp\htdocs\SuperFastSMS\Clients\QuickSMS.php on line 41

Re: Warning: Failed to open stream

Posted: Fri Sep 25, 2009 1:22 am
by Griven
That means it cannot find the dbconfig.php file. With just one set of double dots, it's looking in the SuperFastSMS folder. You may have to add more ../ onto it if it's further up the file structure.

Re: Warning: Failed to open stream

Posted: Fri Sep 25, 2009 4:22 am
by jackpf
Or use an absolute reference.

Re: Warning: Failed to open stream

Posted: Fri Sep 25, 2009 7:27 am
by uyewq
for the inclusion, path problems:

after complexity increases i used my method below. now, i am happy with this method because
it has an advantage to easily transfer your files in future & all links are absolutely will be working without much effort

i include below file to my pages
<?php
/* php include("{$rootfolder}php/examplefile.php");?> */
$rootfolder = "/home/username/public_html/"; // it can be different in your system maybe
/*<link rel="stylesheet" href="<?php echo $belowfolder; ?>css/dis.css" type="text/css">*/
$belowfolder = "/";
?>
in future if i transfer all my portal from root to folder 'transfer' then
$belowfolder becomes = "/transfer/"
$rootfolder becomes = "/home/username/public_html/transfer/";

hope it gives some idea