leo80
(Tsantarll)
June 3, 2013, 5:16pm
1
Hello everybody,
I managed to complete my first project with Yii.
I tried to get online .
When i write mydomain_name.com i see the message:
"The server encountered an internal error." etc
My localhost/mydomain_name works without problems.
Do i have to change something in the index.php?
Such as
$yii=dirname(__FILE__).'../yii/framework/yii.php';
or
$config=dirname(__FILE__).'/protected/config/main.php';
konapaz
(Konapaz)
June 3, 2013, 6:37pm
2
Hi @leo80
Did you upload both your project and the Yii framework on your server?
Yii framework is on the right path?
Also your server may has settings that not show the warnings and errors
Trace step by step your code by echoes among each line and die() php function
leo80
(Tsantarll)
June 3, 2013, 7:03pm
3
Thank you for the reply,
I have uploaded the Yii framework with my project.
Yii is on the right path.
konapaz
(Konapaz)
June 3, 2013, 7:09pm
4
Ok, check the variables of index.php . Also set reporting error to All
error_reporting(-1);
ini_set('error_reporting', E_ALL);
$yii=dirname(__FILE__).'/../yii/framework/yii.php';
$config=dirname(__FILE__).'/protected/config/main.php';
defined('YII_DEBUG') or define('YII_DEBUG',true);
defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
echo $yii.'<br/>';
echo $config;
require_once($yii);
Yii::createWebApplication($config)->run();
leo80
(Tsantarll)
June 4, 2013, 5:44pm
5
I found the error.
I had an extra space between quotes at "connectionString" configuration.
I changed the code to:
'db'=>array(
'connectionString' => 'mysql:host=host_server.com;dbname=db_my_name;',
'emulatePrepare' => true,
'username' => 'my_name',
'password' => 'my_pas',
'charset' => 'utf8',
),
konapaz
(Konapaz)
June 4, 2013, 8:38pm
6
leo80:
I found the error.
I had an extra space between quotes at "connectionString" configuration.
I changed the code to:
'db'=>array(
'connectionString' => 'mysql:host=host_server.com;dbname=db_my_name;',
'emulatePrepare' => true,
'username' => 'my_name',
'password' => 'my_pas',
'charset' => 'utf8',
),
As Anyone has to take into consideration the various settings (and php-mysql version). Also Anyone has to check the little changes between localhost and online server
There were a lot of time that I forgot to do this correctly, but I take the connection error and corrected it
Your server was configured to not displays error messages, So it was difficult to identify the error