Cannot Redeclare Class in New XAMPP Install

I recently ran into a new error after I installed xampp for the first time on my new computer. Check it:

Cannot redeclare class 'Config' in /Applications/XAMPP/xamppfiles/lib/php/Config.php on line 44

Amazing.

This is happening because PHP doesn’t initially know where to look for your “config.php” file. I know I know, it’s a common name. Anyway, to fix this little gem, you need to edit your php.ini file.

Change the line in /Applications/XAMPP/etc/php.ini here:

;include_path = ".:/php/includes"

to:

include_path = ".:/php/includes"

NOTE: you may also need to change to something like this depending on your setup:

include_path = ".;.:/php/includes"

This should tell php to look in the current working directory before looking for its root path to a random config file.

Crazy town.

6 thoughts on “Cannot Redeclare Class in New XAMPP Install

  1. Thank you very much. That was just the trick to get it working.

    I experienced this problem tonight while installing a plugin on a local WordPress install.

    Thanks for hunting down the problem and posting a fix.

    Note: I had to use the second line, with the modified path.

Leave a Reply

Your email address will not be published. Required fields are marked *