我最近将一个旧的SilverStripe 2.3网站从旧的Apache 2.0服务器迁移到了带有PHP 5.4的新nginx。
尽管我设法解决了大多数问题并且可以访问管理员/资产文件夹,但我仍然无法访问管理员,站点管理器和仪表板的重要页面。当我尝试转到站点管理器或仪表板页面时,我看到一个空白的白色屏幕,没有错误。
谁能告诉为什么会这样?
Nginx 日志
FastCGI sent in stderr: "PHP message: PHP Strict Standards: Declaration of Controller::handleRequest() should be compatible with RequestHandler::handleRequest($request) in /var/www/mydomain/sapphire/core/control/Controller.php
call_user_func() expects parameter 1 to be a valid callback, non-static method Hierarchy::extraStatics() should not be called statically in /var/www/mydomain/sapphire/core/model/DataObjectDecorator.php
SilverStripe 2.3 在 PHP 5.4 上不起作用。
SilverStripe 2.3 是在 PHP 5.2 上开发的。蓝宝石核心使用了许多在 PHP 5.3 和 PHP 5.4 中弃用或删除的 PHP 5.2 代码。
您要么需要升级您的 SilverStripe 版本,要么将网站移动到支持旧版本 PHP 的 Web 服务器。
几点注意事项。
银条2.3发布于2009-02-23。
2.3(2.3.13( 的最新更新发布于 2012-02-01。
不再支持 2.3。
银条2.4发布于2010-05-05。
2.4(2.4.10( 的最新更新发布于 2013-02-19。
2015-03-31 之后将不再支持 2.4。
在撰写本文时,最新版本的SilverStripe是3.1.8。我建议升级到最新版本的SilverStripe。这可能很困难,具体取决于站点中自定义代码和模块的数量。
至于您的特定错误之一:
FastCGI sent in stderr: "PHP message: PHP Strict Standards: Declaration of Controller::handleRequest() should be compatible with RequestHandler::handleRequest($request) in /var/www/mydomain/sapphire/core/control/Controller.php
正如错误所说,Controller
函数handleRequest()
应具有与RequestHandler
函数handleRequest($request)
相同数量的参数。尝试将Controller
函数声明更改为 handleRequest($request)
。
这可能会导致更多错误,或者您可能有更多此类错误需要修复。这就是为什么我建议升级而不是尝试使用修复程序编辑蓝宝石代码的原因。