安装CakePHP 3后的空白页 [英] Blank page after installing CakePHP 3

查看:56
本文介绍了安装CakePHP 3后的空白页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将CakePHP 3的新安装复制到Webhotel。在我的本地安装中,它可以正常运行,并显示标准的启动页面,但是在webhotel上,我得到一个空白页面。

I have copied a new installation of CakePHP 3 to a webhotel. On my local installation it runs without problems and shows the standard startup page, but on the webhotel I get a blank page.

如果我将test.php放在/ webroot中

If I place a test.php in /webroot it displays without errors.

如果我在webroot / index.php中包含
echo'Show this line'
就在$之前b $ b需要dirname( DIR )。 ‘/config/bootstrap.php’;
它会显示。

If I in webroot/index.php include an echo 'Show this line' just before the line with require dirname(DIR) . '/config/bootstrap.php'; it is displayed.

如果我将回显线移到require线以下,它将不会显示。

If I move the echo line below the require line it will not display.

因此错误必定与require行有关。

So the error must be with require line.

基于我在Google上找到的内容,我在webroot / index.php的顶部包含了以下内容文件:

Based on what I have found with Google I have included the following at the top in the webroot/index.php file:

ini_set('display_errors', 1);
error_reporting(E_ALL|E_STRICT);

在显示页面时,这给了我以下错误:

This gives me the following error when I display the page:

Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /.../config/bootstrap.php on line 106

config / bootstrap.php中的第106行如下:

Line 106 in config/bootstrap.php looks like this:

(new ConsoleErrorHandler(Configure::read('Error')))->register();

就像我刚开始写的那样,如果我在本地运行相同的设置,我不会收到错误消息,因此,我的猜测是我在Webhotel上缺少php扩展名或其他内容。

As I wrote at the start if I run the same setup locally I don't get the error, so my guess is that I am missing a php-extension or something else on the webhotel.

作为结尾,我可以在Webhotel上运行CakePHP 2而不会出现问题。

As an endnote I can run CakePHP 2 without problems on the webhotel.

推荐答案

您的网络酒店似乎正在运行PHP< 5.4。 CakePHP 3至少需要PHP 5.4.16才能正常运行。

It looks like your webhotel is running PHP < 5.4. CakePHP 3 requires at least PHP 5.4.16 to run correctly.

您可以在以下链接中查看支持PHP> = 5.4

You can check the following link for a list of hosts that support PHP >= 5.4

http://phpversions.info/

这篇关于安装CakePHP 3后的空白页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆