If you are using Yii1’s Gii Module and have upgraded to PHP 7+ you might be getting a 500 error message thrown at you when previewing Model diff code changes.
Methods with the same name as their class will not be constructors in a future version of PHP; Text_Diff has a deprecated constructor
I have recently upgraded PHP version for one of my projects. Speed improvement went was massive so it’s something that I would really recommend.
The application in question is still using Yii version 1. The good news is that the folk behind the Yii framework have release version 1.1.17 which makes it compatible with PHP 7+
Here below is my simple fix for the issue with the Gii Module. In the www/index.php file
if (strpos($_SERVER['REQUEST_URI'], '/gii/model/diff/id/') !== false) { error_reporting(0); ini_set('display_errors', 0); } require_once($yii); ...
Simple!
UPDATE: on the 19th of April Yii has released Yii 1.1.18 which fixes various PHP 7 issues including the incompatibility bug in the Yii Module.
juan carlos cortes says:
thanks, It has helped me a lot