You are here: Problems with require_once() and directory structure « All PHP « IT news, forums, messages
Problems with require_once() and directory structure

Posted by Bit Byte on 10/11/84 11:59

I have written a number of PHP include files. I have carefully
partitioned them into logical folders - based on functionality. My
directory structure looks something like this:

$(rootdir)/includes/
$(rootdir)/includes/patterns
$(rootdir)/includes/core/db
$(rootdir)/includes/core/utils
$(rootdir)/includes/core/logger
....

etc.

Each folder contains one or more files. I wrote the following script to
test my db classes:

<?php
echo "In script\n" ;
include ("/db/mysql_database.inc.php");
echo "Got here\n" ;

try
{
echo "Attempting to instantiate db object\n" ;
$m_dbconnection = new MySQLDatabase();
echo "Object created succesfully\n" ;
}
catch (Exception $e)
{
echo "Exception caught : " . $e->getMessage() . "\n" ;
}
?>

Output: "In script Got here Attempting to instantiate db object "

I cannot, for the life of me, work out wtf is wrong iwth the script, and
why I can't seem to use my directory structure. The above script is
being run from $(rootdir). $(rootdir) is in folder htdocs under Apache.

Additional Info:
----------------------
PHP Version: PHP5
Web Server: Apache 2.0
OS: Windows 2K

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация