Setting up a PHP environment; Class not found error
Posted by: Marsoups (---.qld.bigpond.net.au)
Date: July 25, 2006 04:43AM

Hi all,

I'm wondering if any of you can help me with this problem I'm facing. I'll try to describe what's happening here as best as I can.

Alright, I've set up my environment inside the wamp directory, in g:\wamp\www\test

Now, if I run this page, it will correctly find the correct page and execute the instructions on this page.

There is an included class in the code, as quoted below :
/* Setup the template and add some needed constants */
require_once(BASE_DIR . '/includes/template.class.php');

Now, inside this template class, it defines a class called "template". I'm assuming that the BASE_DIR variable that I have set up is correctly pointing to the correct location, since when I make changes to this template file it shows corresponding errors.

The template file looks something like this :
class template {
// lots of code here
// etc. etc.
}

Okay, let's back away from this template include now, and go back to the original index file that includes it. The offending line appears to be the line directly after the require_once line mentioned some lines above.
It says :
$tpl = new template();

THis causes an error when I open the page and I get the message :
Fatal error: Class 'template' not found in G:\wamp\www\test\header.php on line 22

Does anybody know why this may be happening? Is it a permission thing in apache ? Perhaps a problem in the templates code that means it doesnt' compile as a class ?



Post Edited (07-25-06 04:44)

Options: ReplyQuote
Re: Setting up a PHP environment; Class not found error
Posted by: CyberSpatium (67.170.181.---)
Date: July 25, 2006 05:07PM

require_once($_SERVER[''DOCUMENT_ROOT''] . '/includes/template.class.php');

Options: ReplyQuote


Sorry, only registered users may post in this forum.