0
votes

I moved my app from one server (develop) to other (release) and cake is falling in file lib/Cake/bootstrap.php which is one of cake core files.

the former address (which is running) is http://sdruzenid.kho.cz at address http://sdruzenid.cz is the error.

I just copied all files from one server to other. There was no hard-coded addresses

At first server the adresar structure was

root: /sdruzenid
app: /sdruzenid/app
webroot: /sdruzenid/app/webroot
adresar www is not used (because the other web runs in it and this is just subdomain)

in new location it is
root: /www
app: /www/app
webroot: /www/app/webroot

when I print paths from app/webroot/index.php it is:
ROOT: /httpd/html/sdruzenidcz/www
WWW_ROOT: /httpd/html/sdruzenidcz/www/app/webroot/
CAKE_CORE_INCLUDE_PATH: /httpd/html/sdruzenidcz/www/lib:/httpd/html/sdruzenidcz:./

the error is cased by this code in lib/Cake/bootstrap.php

App::uses('ErrorHandler', 'Error');
App::uses('Configure', 'Core');
App::uses('CakePlugin', 'Core');
App::uses('Cache', 'Cache');
App::uses('Object', 'Core');
App::$bootstrapping = true;

the error is at last line. I cant find where variable $bootstrapping is defined or set but this is in cake core and on develop deploy it works fine

In my code app/webroot.index.php near error is:

if (!defined('CAKE_CORE_INCLUDE_PATH')) {
    if (function_exists('ini_set')) {
        ini_set('include_path', ROOT . DS . 'lib' . PATH_SEPARATOR . ini_get('include_path'));
    }
    //it crashes after include of bootstrap.php
    if (!include 'Cake' . DS . 'bootstrap.php') {
        $failed = true;
    }
} else {
    if (!include CAKE_CORE_INCLUDE_PATH . DS . 'Cake' . DS . 'bootstrap.php') {
        $failed = true;
    }
}
2

2 Answers

3
votes

Delete all cache files on

  • app/tmp/cache/models
  • app/tmp/cache/persistent
1
votes

The problem was simple. On hosting was low version of php. After upgrade all went fine.

So by short: If you have error in cake/core/bootstrapping.php on line 144, upgrade your php.