Page 1 of 1

Installation error

Posted: Wed Oct 05, 2011 6:45 pm
by enofman
I installed CakePhp and then install Zuluru I can make it to the submit form for the database but when it is submitted the following error is logged in Apache

[Wed Oct 05 16:26:55 2011] [error] [client 127.0.0.1] PHP Fatal error: Cannot redeclare class DATABASE_CONFIG in C:\\server\\www\\cake\\zuluru\\config\\database.php on line 74, referer: http://localhost/cake/zuluru/install/install/database. It appears to me to be a path problem, but I have looked at everything I can think of and reinstalled multiple time and continue to get the same error. Since I am green as grass on the whole CakePhp could you please point me in the right direction.
Apache 2.2.21 -- MySql 5.5.16 -- Php 5.3.8 -- Windows 7 32bit
Thanks in advance
Gary

Re: Installation error

Posted: Fri Oct 07, 2011 4:45 pm
by GregS
If you already have a config/database.php file, try deleting it (or renaming it, if you don't want to lose it). Make sure that the database.php.default file is still there. If that doesn't work, setting the debug level to 2 in config/core.php, should get you a more comprehensive error message from Cake, including the call stack, and hopefully information about when DATABASE_CONFIG was initially declared, which should help to narrow things down.

Re: Installation error

Posted: Fri Oct 07, 2011 10:46 pm
by enofman
Greg,
First thanks for the help, I really want to try this to see if it will work for our Pick (kind of like darts, but smaller board, also called American Darts) League. After I changed the debug value, I found that the port number is not optional, (maybe it is suppose to be, but not on my local machine) I put the port number in and viola it went through with the install, now to test the rest of the system.
Thanks for your efforts much appreciated,
Gary

Re: Installation error

Posted: Sat Oct 08, 2011 10:27 pm
by GregS
Can I ask what database you are using, and what is the port number?

Re: Installation error

Posted: Sat Feb 01, 2014 1:57 pm
by vrehorst
Sorry to resurrect this thread, but I figured out what was causing this issue last night while I was doing an install myself.

The problem is that the 'port' key in the DATABASE_CONFIG class cannot have an empty value. To use the driver defaults the 'port' key has to be omitted from the class.

This happened to me with both the mysql and mysqli drivers, and with CakePHP 1.3.15.

If I get free time in the near future I'll fork this on github and send a pull request.

Re: Installation error

Posted: Sat Feb 01, 2014 2:07 pm
by GregS
That is a later version of CakePHP 1.3 than I'm running Zuluru on, so maybe they've changed something in the interim, but it's working just fine with a blank port for me. A patch would be great!

Re: Installation error

Posted: Sat Jan 17, 2015 1:33 am
by sinadee
When I was using a blank database, I deleted any config/database.php file. Then I went into the config/database.php.default file and commented out/omitted the port line as enofman said. Reran the installation and it worked.