Yii Framework Forum: Install Yii On Centos 6.4 - Yii Framework Forum

Jump to content

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

Install Yii On Centos 6.4 Rate Topic: -----

#1 User is offline   xiaoxiaoshijie 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 16
  • Joined: 11-June 13

Posted 18 June 2013 - 01:20 AM

I got the following error when I try to install a yii project on Centos 6.4, Can anyone help me? This project works well on Ubuntu though.

---------------
setTimezone(new DateTimeZone(Yii::app()->params['timezone'])); return $dt->format($format); } # Convert date in UTC to local timezone for application public static function dateToLocal($date) { $dt = new DateTime($date, new DateTimeZone("UTC")); $dt->setTimezone(new DateTimeZone(Yii::app()->params['timezone'])); return $dt->format('Y-m-d'); } public static function addDays($days, $datetime='') { if ($datetime) { $time = strtotime($datetime) + (60 * 60 * 24 * $days); } else { $time = time() + (60 * 60 * 24 * $days); } return date('Y-m-s H:i:s', $time); } public static function get($array, $key, $default = null) { return isset($array[$key]) ? $array[$key] : $default; } public static function supportedLanguages() { return self::get(Yii::app()->params, 'languages', array()); } public static function isLanguageSupported($language) { return in_array($language, array_keys(self::supportedLanguages())); } public static function changeLanguage($language) { if (Utils::isLanguageSupported($language)) { Yii::app()->session['language'] = $language; Yii::app()->language = $language; } } public static function languageChangingLinks($base = '/site/changeLanguage') { $languages = self::supportedLanguages(); $items = array(); foreach($languages as $id => $name) $items []= CHtml::link($name, array($base, 'lang' => $id), ($id !== Yii::app()->language)? array('style' => 'margin: 0px 5px;') :array('style' => "font-weight:bold;margin: 0px 5px;")); return implode('|', $items); } public static function newSphinxClient() { $s = new SphinxClient; $s->setServer(Yii::app()->params['sphinx_servername'], Yii::app()->params['sphinx_port']); $s->setMaxQueryTime(5000); $s->setLimits(0, 5000); $s->setMatchMode(SPH_MATCH_EXTENDED); return $s; } public static function convertDate($date){ date_default_timezone_set('America/Los_Angeles'); return @strtotime($date); } } ?>

---------------------------------------

The code it related seems like the following one,

--------------
/* Set the app language if the session's language is supported */
$language = Utils::get(Yii::app()->session, 'language', Yii::app()->params['language']);
if (Utils::isLanguageSupported($language))
Yii::app()->language = $language;
-------------------

The log says, could not find the class "Utils".

I do need help, thanks a lot.
0

#2 User is offline   xiaoxiaoshijie 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 16
  • Joined: 11-June 13

Posted 19 June 2013 - 01:54 AM

Can anyone help? It looks like I see this msg for every webpage.
0

#3 User is offline   Yong Li 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 15-November 13

Posted 15 January 2014 - 10:42 AM

Same problem happened for my CentOS 6.5 installation. After several days working on the debug, I realized the issue was caused by the stupid human error. By default the php installation on CentOS not supporting the short tag '<?' and required the long tag '<?php'. If you want to use the short tag, please change php.ini and set short_opentag=On. But definitely, I will recommend to use the long tag.
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