PHP Class trouble

Problems with the Windows version of XAMPP, questions, comments, and anything related.

PHP Class trouble

Postby BenjaminFedder » 02. October 2008 23:23

Hello :)

I'm a newbie at this whole WAMP thing, being used to webhotels and other hosting solutions. But It's about time I get get my own server going, and for this occasion I have installed it on my USB stick.

I tried WampServer2 first, but I didn't like the interface. Also there was no launcher for PortableApps, which I use to keep track of all my portable applications.

My problem is this:

I program PHP by OOP, and XAMPP gives me some errors I have never seen, concerning classes.

Code: Select all
Fatal error: Class 'Config' not found in F:\xampp\htdocs\CreativeBen2.0\FedderCMS\Page.php on line 23


This is one. It makes little sense to me - I use "require" to load the file with the class Config in it, so the file is loaded, else it would have terminated before trying to instantiate the class.

I also tried copying the class to Page.php, but then it gave me an even stranger error:

Code: Select all
Fatal error: Call to undefined method Page::Initialize() in F:\xampp\htdocs\CreativeBen2.0\FedderCMS\Page.php on line 65


That method is from a class inherited from that other file as well...

It's worth mentioning that this works on two of my hosting solutions, as well as in WampServer2, so I think it must be some sort of configuration trouble?

I'm a bit in the black here... I shouldn't be doing any strange code - It's fairly standard OOP and I made it while reading the official PHP documentation on the PHP way of doing it. But of course, it may be wrong? (I learned OOP in C++, so I'm still getting used to PHP)

I hope I get can get some help... Couldn't find any on the page, but I may have missed it - in that case, I'd ask for a pointer to where to look ;)

Thanks,
Benjamin Jensen

EDIT: I'm going to try using the configuration for WampServer2, since it worked. I'll report back if I'll learn anything.
BenjaminFedder
 
Posts: 2
Joined: 02. October 2008 23:12

Postby BenjaminFedder » 03. October 2008 00:07

I first tried copying PHP.ini from WampServer2, but ended up copying the whole folder. Then it worked.

So I don't know the reason, but at least this is a solution :)
BenjaminFedder
 
Posts: 2
Joined: 02. October 2008 23:12


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 89 guests