-1

The main reason for not loading a config file in the server which worked well in localhost:

Code Snippet from public_html/admin.php

$yii = dirname(__FILE__) . '../framework/yii.php';
$config = dirname(__FILE__) . '/admin/config/main.php';

print_r($config);

Result in localhost:

C:\xampp\htdocs\*****/admin/config/main.php

Result in sever:

/home/folder_name/domains/*****/public_html/admin/config/main.php

Sever Result from public_html/index.php:

/home/folder_name/domains/******/public_html/protected/config/main.php

I am writing this because I had spent hours to trace the point.Its working in FrontEnd but not working in BackEnd. What was the main reason?

ersks
  • 1,409
  • 2
  • 16
  • 23

1 Answers1

0

Finally, I got the answer:

$yii = dirname(__FILE__) . '../framework/yii.php';

This code is used during multiple domain on single hosting. But the code needs correction:

$yii = dirname(__FILE__) . '/framework/yii.php';

I have uploaded framework folder within public_html.

ersks
  • 1,409
  • 2
  • 16
  • 23