Yii is a great framework. It gives excellent built-in functionality, but, from my experience, is quite sensitive to the server configuration. Mostly because it relies on the newest technologies.
So here is a list of things to check when you experience strange things (blank screen without any messages is the worst one that may happen):
- Check PHP version. Yii needs 5.1 at least. When using some specific PDO or other features in your application, ensure they’re available in the server’s PHP installation.
- Check MySQL version. Should be at least 5. If it differs from development one (e.g. server has 5.0.21 and you have 5.0.51), then pay attention to the CDbConnection::emulatePrepare. Actually if you’re using MySQL, you’d better turn it on because MySQL doesn’t cache prepared statements and has buggy support for some types of qeries (e.g. SHOW)
- If you’re using automated timestamps insertion like described in Yii Cookbook, you may encounter problems, when using different PDO or MySQL version. If you see your queries fail, try using
instead of
-
new CDbCommand(‘NOW()’)
- When you can’t see any output, configure logging. If log is emply also, try die(‘message’) in all possible places. Starting from the entry script, continuing to your controller’s action. In some cases PHP crash is possible, which leads to immediate application termination, which makes both Yii logging and PHP’s echo ineffective and only die() workds fine
- When using different PHP version, PDO versin may be different also. If you have application crashes when using bindParam(), try using bindValue() instead. This helps sometimes
- Don’t forget to switch off YII_DEBUG in the index.php (entry script). However, if you encounter any problems, switch it back to help debugging
No related posts.
Related posts brought to you by Yet Another Related Posts Plugin.
Share this post with a friend











jz says:
s/debgging/debug/ #IMHO
May 26, 2009, 02:17James from FaceySpacey.com says:
Great Yii starter post bro!
October 24, 2009, 13:42snnwolf says:
Remember setup CLogEmailRouter for error application reporting
January 23, 2010, 11:27Rubén says:
Hi, your tip date save me, thanks.
February 22, 2010, 10:53comment maigrir says:
comment maigrir vite…
[...] Avec des céréales granola, vous pouvez trouver quelques variétés saines toutefois à nouveau vous devez regarder à la fois en calories et en sucre (et parfois même du gras!) Contenu [...]…
June 4, 2010, 14:54Autovermietungen in Mallorca says:
Mietwagen am Flughafen Mallorca…
hey I don’t normally make post about others but your post was a real call to action. Thank you for a great read, I’ve just added a post to my own blog….
July 11, 2010, 12:10