Hi,
I am using Lunarpages web hosting.
I try to test yii configuration with the demo app Blog:
1. I installed yii under public_html folder as the following. The blog app comes out file.
/public_html/yii/framework
/public_html/yii/demos/blog
2. Then I move the framework folder out of the public_html folder as follows:
/public_html/yii/demos/blog
/yii/framework
and modified the statement in index.php
from: $yii=dirname(__FILE__).'/../../framework/yii.php';
to: $yii=dirname(__FILE__).'/../../../../yii/framework/yii.php';
and add echo statements in both yii.php and main.php.
Both echo statement are displayed, no error displayed, but the blog app doens't come up.
I did the same test in my localhost with wamp server, the blog app comes up fine.
Does the framework folder have to be under public_html folder in a web hosting environment or there is something I missed?
Thanks,
jdev009
Page 1 of 1
move framework folder out of public_html directory
#2
Posted 09 February 2012 - 06:24 PM
That depends on your web host.
Put this in your index.php:
Adjust the path until it stops failing.
Put this in your index.php:
$yii=dirname(__FILE__).'/../../yii/framework/yii.php';
if(!file_exists($yii))
{
die("<font color=\"red\">Error:</font> Cannot find Yii!<br/>
Please check and correct the path to Yii in <em>{$_SERVER['SERVER_NAME']}/index.php</em>");
}
Adjust the path until it stops failing.
"Less noise - more signal"
#3
Posted 09 February 2012 - 10:40 PM
jacmoe,
thank you for your help. The path for $yii was current and verified with the code you suggested.
I checked the web server error log, it says:
PHP Fatal error: Class 'CController' not found in /home/mydomain/public_html/yii/demos/blog/protected/components/Controller.php on line 6.
So it seems the framework is not loaded. Is there any other property to be set to load framework classes?
thank you for your help. The path for $yii was current and verified with the code you suggested.
I checked the web server error log, it says:
PHP Fatal error: Class 'CController' not found in /home/mydomain/public_html/yii/demos/blog/protected/components/Controller.php on line 6.
So it seems the framework is not loaded. Is there any other property to be set to load framework classes?
#4
Posted 09 February 2012 - 11:19 PM
jacmoe,
Never mind, somehow, CController.php was corrupted. After I reuploaded the class file, the blog app works!
Thank you again.
Never mind, somehow, CController.php was corrupted. After I reuploaded the class file, the blog app works!
Thank you again.
Share this topic:
Page 1 of 1

Help











