Yii Framework Forum: Go Online - Real World Server - Index.php - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Go Online - Real World Server - Index.php Rate Topic: -----

#1 User is offline   leo80 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 13
  • Joined: 24-December 12

Posted 03 June 2013 - 12:16 PM

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';

0

#2 User is offline   KonApaz 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,317
  • Joined: 21-February 11
  • Location:Greece

Posted 03 June 2013 - 01:37 PM

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
Yii is the best php framework in the world!
find our demo Yii extension on www.webkit.gr
Is it post useful? please v++ ;)
0

#3 User is offline   leo80 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 13
  • Joined: 24-December 12

Posted 03 June 2013 - 02:03 PM

Thank you for the reply,

I have uploaded the Yii framework with my project.
Yii is on the right path.
0

#4 User is offline   KonApaz 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,317
  • Joined: 21-February 11
  • Location:Greece

Posted 03 June 2013 - 02:09 PM

View Postleo80, on 03 June 2013 - 02:03 PM, said:

Thank you for the reply,

I have uploaded the Yii framework with my project.
Yii is on the right path.


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();

Yii is the best php framework in the world!
find our demo Yii extension on www.webkit.gr
Is it post useful? please v++ ;)
0

#5 User is offline   leo80 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 13
  • Joined: 24-December 12

Posted 04 June 2013 - 12:44 PM

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',
), 

0

#6 User is offline   KonApaz 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,317
  • Joined: 21-February 11
  • Location:Greece

Posted 04 June 2013 - 03:38 PM

View Postleo80, on 04 June 2013 - 12:44 PM, said:

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
Yii is the best php framework in the world!
find our demo Yii extension on www.webkit.gr
Is it post useful? please v++ ;)
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users