Under PHP 7.0.22, CakePHP 2.6.4, an error is reported: ERROR: Cannot usestringAs class name as it is reserved
1. Under CakePHP 2.6.4, the error is reported: Error: Cannot usestringAs class name as it is reserved, as shown in Figure 1
2. String is the reserved name in PHP 7.x, so the String class in the Cake cannot be used on PHP 7.x, upgrade to the latest 2.x, and use CakeText instead, as shown in Figure 2
Reference URL:https://book.cakephp.org/2.0/en/appendices/2-7-migration-guide.html#utility, the class String has been renamed to CakeText, which resolves compatibility with HHVM and some conflicts with PHP7+. For compatibility reasons, a String class is also provided.
3. Open the URL:https://github.com/cakephp/cakephp/tags, select 2.10.3, as shown in Figure 3
4. Rename the lib in the application directory to lib-2.6.4, as shown in Figure 4
5. Copy the lib in the download package to the application directory, as shown in Figure 5
6. After the upgrade is successful, the error has disappeared, normal, as shown in Figure 6





