Sachy Sachy - 1 year ago 60
PHP Question

Parsing Error on WebServer (live Server) and no Parsing Error on Local Machine

I developed and tested an application on my local machine.. everything works perfectly!
When I migrated this to a live server I keep getting all the parsing errors!!
For e.g

I don't know what is the error on the following code?

Parse error: syntax error, unexpected T_FUNCTION, expecting ')' in /home/content/index.php on line 126

Line 126 is line 3 (starting from items) below


return array(

'image' => Yii::app()->baseUrl.'/'.CHtml::encode($record['file_location']),
'imageOptions'=>array('style'=>'height: auto; max-height: 1000px; overflow:auto; max-width: 900px;margin-bottom: 0 auto;'),

'itemOptions' => array('class'=>'carousel-inner','style'=>'height:800px;margin-top:0px;margin-left:0px'),
'captionOptions'=>array('style'=>'background: none repeat scroll 0 0 rgba(0, 0, 0, 0.4);'),
'caption'=>$this->renderPartial("_frontCaptionContent",array('record'=>$record,'cc'=>new ECurrencyHelper()),true),



Answer Source

This is because of you are using anonymous function in below line:

      return array(

This feature is available as of PHP version 5.3 and above. So you need to upgrade your server's PHP version to +5.3 or you should not use anonymous functions.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download