Need some help resolving this error

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
arukomp
Forum Contributor
Posts: 113
Joined: Sun Sep 24, 2006 4:22 am

Need some help resolving this error

Post by arukomp »

Hi again,

I have a file called health.php:

Code: Select all

<?php

require_once("../inc.functions.php");
db_connect();
get_user_data();

$health = $_SESSION['userdata']->health;
$max_health = $_SESSION['userdata']->sta * 10;
echo "<span class=\"greenname\" style=\"font-size:14px;\">Health Points</span><br><br>";
echo "$health / $max_health Health Points";

mysql_close();

?>
It's local path is "C:\Program Files\xampp\htdocs\script\inc"

Now when I try to load that page I get the following error:

Fatal error: Cannot redeclare class config in C:\Program Files\xampp\php\pear\Config.php on line 43

I don't understand what is it all about php\pear\Config.php file if it's not even included in any of my scripts. Anyway, 43rd line on php\pear\Config.php file:

Code: Select all

class Config {
Please help me resolving this error, I have no idea about it :(
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Descriptive subjects

Post by RobertGonzalez »

Somewhere there is a class called Config that is already included and you are trying to create another class called Config after that first Config class is included.

Oh yeah:
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:2. Use descriptive subjects when you start a new thread. Vague titles such as "Help!", "Why?" are misleading and keep you from receiving an answer to your question.
arukomp
Forum Contributor
Posts: 113
Joined: Sun Sep 24, 2006 4:22 am

Re: Descriptive subjects

Post by arukomp »

Everah wrote:Somewhere there is a class called Config that is already included and you are trying to create another class called Config after that first Config class is included.

Oh yeah:
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:2. Use descriptive subjects when you start a new thread. Vague titles such as "Help!", "Why?" are misleading and keep you from receiving an answer to your question.
I've sorted it out. Include path was the one in error, so I just changed include path to "/" and everything worked out fine

And sorry about the subject of the thread
suyeic
Forum Newbie
Posts: 6
Joined: Wed Jun 13, 2007 9:22 pm
Location: Bejing China

Post by suyeic »

Please check this file ("../inc.functions.php"),and thse two functions you invoked.
Post Reply