Importing a CakePHP site to XAMPP


I am a small business owner with engineering background. I have a website developed with CakePHP. I would like to create an offline copy of my website from the site backup to be imported to XAMPP on windows platform.

I need the offline copy for learning and development purpose.

Any help will be much appreciated.


Copy the code, dump the database, load them both onto your XAMPP server. Anything more detailed would get to be pages long. If there are specific bits that you’re having trouble with, elaborate on what you’ve done and where you’re blocked.


Thank you…somehow I was not able to the same thing before you mentioned. I am moving forward now and now when I tried to load site following errors are reported in Apache error.log

Fri Jan 25 15:18:16.139996 2019] [php7:error] [pid 9644:tid 1544] [client ::1:33975] PHP Fatal error: Cannot use ‘Object’ as class name as it is reserved in C:\xampp\htdocs\spacovers\lib\Cake\Core\Object.php on line 30
[Fri Jan 25 15:18:16.699996 2019] [php7:error] [pid 9644:tid 1544] [client ::1:33975] PHP Fatal error: Uncaught Error: Class ‘Controller’ not found in C:\xampp\htdocs\spacovers\lib\Cake\Error\ExceptionRenderer.php:174\nStack trace:\n#0 C:\xampp\htdocs\spacovers\lib\Cake\Error\ExceptionRenderer.php(92): ExceptionRenderer->_getController(Object(InternalErrorException))\n#1 C:\xampp\htdocs\spacovers\lib\Cake\Error\ErrorHandler.php(126): ExceptionRenderer->__construct(Object(InternalErrorException))\n#2 C:\xampp\htdocs\spacovers\lib\Cake\Error\ErrorHandler.php(274): ErrorHandler::handleException(Object(InternalErrorException))\n#3 C:\xampp\htdocs\spacovers\lib\Cake\Error\ErrorHandler.php(213): ErrorHandler::handleFatalError(64, 'Cannot use ‘Obj…’, ‘C:\\xampp\\htdocs…’, 30)\n#4 C:\xampp\htdocs\spacovers\lib\Cake\Core\App.php(933): ErrorHandler::handleError(64, 'Cannot use ‘Obj…’, ‘C:\\xampp\\htdocs…’, 30, Array)\n#5 C:\xampp\htdocs\spacovers\lib\Cake\Core\App.php(906): App::_checkFatalError()\n#6 [internal function]: App::shutdown()\n#7 {main}\n thrown in C:\xampp\htdocs\spacovers\lib\Cake\Error\ExceptionRenderer.php on line 174


What version of CakePHP, and what version of PHP? Guessing 2.x and 7.2 respectively.


CakePHP 2.9 and PHP 7.3.1


That first link I provided indicates that you need at least CakePHP 2.10 if you’re running PHP 7.2 or higher. Upgrade Cake to 2.10, or downgrade PHP to 7.1.


Actually I have Cake 2.7.3 not 2.9. Would the PHP 7.1 work.


From the migration guides, it seems that the first version of Cake that’s PHP7 compatible is 2.8.


I’d recommend to check whether you could do something using Docker as it keeps the “works on my machine” cases lower, gives you more control over the LAMP/WAMP stack and allows you to build, test and deploy nicely with a CI/CD