require_once Path Error in PHP and Apache

I'm developing a moderately sized website using Dreamweaver CS4 and I've run into a problem with PHP and Apache.  I'm using the most current release versions of each program and I've divided my site into folders primarily for organization.  The problem is that if I have any php files that include php files that include other php files if the base php files are located in a sub directory the includes usually work but in the site root Apache complains in the error log that the files being included in the first included file cannot be found. I've included the relevant PHP files but cut out all the html and php functions to keep them reasonably sized.  The default.php is the default page that opens up when the site is typed in, rotator.php is a php file that include functions for a banner ad type system, and the connBDBannerAds.php is the automatically generated MySQL connection file by Dreamweaver.  Dreamweaver is just fine with all the links but Apache outputs this when it runs:

[Fri May 22 22:42:10 2009] [error] [client 127.0.0.1] PHP Warning:  require_once(../Connections/connBDBannerAds.php) [<a href='function.require-once'>function.require-once</a>]: failed to open stream: No such file or directory in C:\\Program Files (x86)\\Apache Software Foundation\\Apache2.2\\htdocs\\web test\\PHP\\rotator.php on line 1
[Fri May 22 22:42:10 2009] [error] [client 127.0.0.1] PHP Fatal error:  require_once() [<a href='function.require'>function.require</a>]: Failed opening required '../Connections/connBDBannerAds.php' (include_path='.;C:\\Program Files (x86)\\Apache Software Foundation\\Apache2.2\\htdocs\\web test') in C:\\Program Files (x86)\\Apache Software Foundation\\Apache2.2\\htdocs\\web test\\PHP\\rotator.php on line 1

I'm using relative links right now but I've also tried site root ones as well where Dreamweaver changes all the require_once lines with virtual.  I also tried prefixing all the paths with / to make it use the site root but that didn't work either.  
This is my first post so if I forgot to put something in or put too much in please let me know.  Thanks in advance for your time.
default.php
<?php require_once('Connections/connBDCustomers.php'); ?>
<?php require_once('PHP/rotator.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) 
{
     .... Other php stuff ....
}
?>
HTML Body
--------------------------------------------------------------------------------
rotator.php
<?php require_once('../Connections/connBDBannerAds.php'); ?>  <-Problem Here I think
<?php
function rotator()
{
	
}
?>
----------------------------------------------------------------------------------
connBDBannerAds.php
<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_connBDBannerAds = "localhost";
$database_connBDBannerAds = "bdbannerads";
$username_connBDBannerAds = "root";
$password_connBDBannerAds = "test";
$connBDBannerAds = mysql_pconnect($hostname_connBDBannerAds, $username_connBDBannerAds, $password_connBDBannerAds) or trigger_error(mysql_error(),E_USER_ERROR); 
?>

Open in new window

William-BAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Todd MummertCommented:

The paths are not relative to where they're stored, but relative to the include path.

I don't fully understand your layout, but if the directories PHP and Connections are in the same directory, you could probably change your the path to Connections/connBDBannerAds.php

You could also change the include path, or use something based off of DocumentRoot.   See

http://www.mail-archive.com/php-general@lists.php.net/msg139301.html

for a similar problem and solutions
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
William-BAuthor Commented:
Thanks for your  quick response I had set the include directory to point to the site root pretty much, so i took out all of the ../ and / in the require statements and that seems to work just fine.  I had done that before, but it messes up all the recordset and other server behaviors in Dreamweaver so I had undone it thinking I messed something up.  Do you know of anyway to make it so Dreamweaver recognizes custom include paths for php scripts?  At any rate what you suggested did solve my problem, which I appreciate very much so I'm just going to mark this as solved.
0
William-BAuthor Commented:
Thank you for your prompt solution.  It worked great.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.