php error on hosted server- not on local server

HI I am getting this error on hosted server but not on local server.

Fatal error: Call to a member function getAttributeLabel() on a non-object in /home/a3330949/public_html/yii/framework/web/helpers/CHtml.php on line 1154

Any idea,

BR

Vic

hi

check for folder permission.

Thanks

Thanks!!

Can you please be little more detailed(like which folder and what permissions)…its not you…its my inexperience :)

Guys any help?

More information, please. Version of yii, versions of server-side software, etc.

Do you check yii reqirements on the server?

Thanks !!

I am using latest yii.

Host is 000webhost.com.They support PHP5 and above.

Since I have a free account, they do not help much in set up.

I do not know how to find out yii requirements on the server.

Open your /home/a3330949/public_html/yii/framework/web/helpers/CHtml.php and post what you see at line 1154.

Start to read installation instructions in the official guide.

Check permission of the all folders as guide says (assets and runtime must be writable by server).

Thanks for some pointers.

[b] if(isset($htmlOptions[‘label’]))

	{


		if(($label=$htmlOptions['label'])===false)


			return '';


		unset($htmlOptions['label']);


	}


	else


		$label=$model->getAttributeLabel($attribute);   -------------->1154


	if($model->hasErrors($attribute))


		self::addErrorCss($htmlOptions);


	return self::label($label,$for,$htmlOptions);


}[/b]

Yes I will

I have that set up to 777 already

Your dev machine, is it Windows?

Then check that your files is cased properly.

Linux is case sensitive.

This is the most common error people get when deploying their Windows developed app to a *nix server.

Thanks, What files will need a name change? Can you please give some example?

Offtopic: Nickelback, your yii is no latest. It’s 1.1.8 or earlier.

Thanks!! I have updated yii to 1.1.9

Now the php error has moved to 1161 line

Fatal error: Call to a member function getAttributeLabel() on a non-object in /home/a3330949/public_html/yii/framework/web/helpers/CHtml.php on line 1161

From the error message it does not seem to me as a permission or case error…

this message means that the value of the $model variable is not an object… so you need to check your code to see what is it’s value…

when Yii display the error… the first line is in the Yii core as there the error is fired… but before that is echoed the stack trace… find your code that is executed just before the error is fired… and that is the controller, model or most probably the view file where you need to check the value of the $model.