0
votes

I have 2 cakephp directory in my server in separate path . Cakephp application 1 is located in /var/www/html/app1/v11/. this application can accessed via http://example.com . Cakephp application 2 is located in /var/www/html/ app2/ v12/app. This application can accessed via sub.example.com/app2 . Cakephp app 2 having some controllers/models/views of cakephp app 1 excepted 2 new controllers.

When accessing sub.example.com/app2/comps/list url , it shows some undefined error

 Notice (8): Undefined variable: res [APP/Controller/CompsController.php, line 681]
 Code Context
$stack  =   array()
CompsController::trending() - APP/Controller/CompsController.php, line 681
 ReflectionMethod::invokeArgs() - [internal], line ??
Controller::invokeAction() - /var/www/html/app1/v11/lib/Cake/Controller      /Controller.php, line 488
  Dispatcher::_invoke() - /var/www/html/app1/v11/lib/Cake/Routing/Dispatcher.php, line 103

Dispatcher::dispatch() - /var/www/html/app1/v11/lib/Cake/Routing/Dispatcher.php, line 85 [main] - APP/webroot/index.php, line 96 Null

Ie it accessing controller from v11 app. How to avoid this

1

1 Answers

0
votes

I would guess the settings in your webroot/index.php are incorrect.

Specifically, this line - make sure it's different for each app, and points to the correct location.

define('APP_DIR', basename(dirname(dirname(__FILE__))));