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
- 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.