我有一个 cakePHP 网站,今天我将该网站移至新服务器,但出于某种原因,我不断收到错误。它在另一台服务器上运行良好,但这台带有 cpanel 的新服务器似乎无法正常工作。不确定问题是什么。
一些错误:
Notice (8): Trying to get property of non-object [CORE/cake/libs/model/datasources/dbo_source.php, line 549]
Notice (8): Trying to get property of non-object [CORE/cake/libs/model/datasources/dbo_source.php, line 554]
Warning (512): SQL Error: 1146: Table 'mycats.space' doesn't exist [CORE/cake/libs/model/datasources/dbo_source.php, line 440]
Warning (2): Cannot modify header information - headers already sent by (output started at /home/mycats/public_html/cake/basics.php:338) [APP/controllers/app_controller.php, line 168]
Warning (2): Cannot modify header information - headers already sent by (output started at /home/mycats/public_html/cake/basics.php:338) [APP/controllers/app_controller.php, line 169]
Warning (2): Cannot modify header information - headers already sent by (output started at /home/mycats/public_html/cake/basics.php:338) [APP/controllers/app_controller.php, line 170]
Warning (2): Cannot modify header information - headers already sent by (output started at /home/mycats/public_html/cake/basics.php:338) [APP/controllers/app_controller.php, line 175]
答案1
我最初的想法是关注 SQL 错误。我会确认数据库已成功导入。根据消息,无法找到其中一个数据库表:
Warning (512): SQL Error: 1146: Table 'mycats.space' doesn't exist [CORE/cake/libs/model/datasources/dbo_source.php, line 440]
确认 mycats.space 存在后,错误就会减少。通知和警告不应阻止网站加载,但仍应予以解决。
底线是,找到并修复 SQL 错误,然后报告下一组错误并解决它们。
-布伦丹