我已将CakePHP 3的新安装复制到webhotel.在我的本地安装它运行没有问题,并显示标准启动页面,但在webhotel我得到一个空白页面.
如果我在/ webroot中放置一个test.php,它会显示没有错误.
如果我在webroot/index.php中包含一个echo'显示此行'就在使用require dirname(DIR)的行之前.'/config/bootstrap.php'; 它显示.
如果我将回波线移动到要求线下方,它将不会显示.
所以错误必须是require行.
根据我在Google上发现的内容,我在webroot/index.php文件的顶部包含以下内容:
ini_set('display_errors', 1);
error_reporting(E_ALL|E_STRICT);
Run Code Online (Sandbox Code Playgroud)
当我显示页面时,这会给我以下错误:
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /.../config/bootstrap.php on line 106
Run Code Online (Sandbox Code Playgroud)
config/bootstrap.php中的第106行如下所示:
(new ConsoleErrorHandler(Configure::read('Error')))->register();
Run Code Online (Sandbox Code Playgroud)
正如我在开始时写的,如果我在本地运行相同的设置,我没有得到错误,所以我的猜测是我错过了php-extension或webhotel上的其他东西.
作为尾注,我可以在webhotel上运行CakePHP 2而不会出现问题.
看起来你的webhotel运行PHP <5.4.CakePHP 3至少需要PHP 5.4.16才能正常运行.
您可以查看以下链接以获取支持PHP> = 5.4的主机列表