title: Yii2 - Error #1 - An internal server error occurred
body: <p><strong>Greetings</strong></p>
  
  <p><strong>I Have upload to a web server (not local) a Yii2 application into: <a href="http://acastro.wc.lt/" rel="nofollow">http://acastro.wc.lt/</a></strong></p>
  
  <p><strong>The problem is that when trying to switch between ENG or PT languages the framework thows an ERROR #1 - An internal server error occurred.</strong></p>
  
  <p>In my Layout.php i have the following links inside the nav:: Widget:</p>
  
  <pre><code>'options' =&gt; ['class' =&gt; 'navbar-nav navbar-right'],
              'items' =&gt; [
                  ['label' =&gt; 'ENG', 'url' =&gt; ['/site/langus'], 'visible' =&gt; Yii::$app-&gt;user-&gt;isGuest],
                  ['label' =&gt; 'PT', 'url' =&gt; ['/site/langpt'], 'visible' =&gt; Yii::$app-&gt;user-&gt;isGuest],
  </code></pre>
  
  <p>And in my siteController i have the actions to switch between the languages that translate the application in real time:</p>
  
  <pre><code>public function beforeAction($action) {
      if (Yii::$app-&gt;session-&gt;has('lang')) {
          Yii::$app-&gt;language = Yii::$app-&gt;session-&gt;get('lang');
      } else {
          Yii::$app-&gt;language = 'us';
      }
      return parent::beforeAction($action);
  }
  
  public function actionLangus(){  
      Yii::$app-&gt;session-&gt;set('lang', 'us'); //or $_GET['lang']
      return $this-&gt;redirect(Url::toRoute(['site/index']));   
  }
  
    public function actionLangpt(){  
      Yii::$app-&gt;session-&gt;set('lang', 'pt'); //or $_GET['lang']
      return $this-&gt;redirect(Url::toRoute(['site/index']));
  }
  </code></pre>
  
  <p><strong>In my localhost machine installed by MAMP in my MAC OSX Yosemite the links work very well and change in realtime the application language, but in the live server the links ENG and PT throw ERROR #1.</strong></p>
  
  <p>Perhaps there's a problem in my actions in the redirect expression's</p>
  
  <pre><code>Yii::$app-&gt;session-&gt;set('lang', 'pt'); //or $_GET['lang']
  </code></pre>
  
  <p><strong>Any ideas of what could be the issue causing this behavior only in live server? The PHP from the server is updated to one of the recent and last version's.</strong></p>