创建新的Laravel 5项目后出现致命错误

时间:2015-02-05 12:51:11

标签: laravel laravel-5

我通过laravel new mysite创建了一个全新的Laravel 5应用程序。当我打开网站时,我看到以下错误:

Notice: date_default_timezone_set(): Timezone ID '' is invalid in /mysite/storage/framework/compiled.php on line 1790

Fatal error: Call to undefined method Illuminate\Foundation\Bootstrap\ConfigureLogging::configureHandler() in /mysite/storage/framework/compiled.php on line 1656

这是我的composer.json:

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "laravel/framework": "5.0.*"
    },
    "require-dev": {
        "phpunit/phpunit": "~4.0",
        "phpspec/phpspec": "~2.1"
    },
    "autoload": {
        "classmap": [
            "database"
        ],
        "psr-4": {
            "App\\": "app/"
        }
    },
    "autoload-dev": {
        "classmap": [
            "tests/TestCase.php"
        ]
    },
    "scripts": {
        "post-install-cmd": [
            "php artisan clear-compiled",
            "php artisan optimize"
        ],
        "post-update-cmd": [
            "php artisan clear-compiled",
            "php artisan optimize"
        ],
        "post-create-project-cmd": [
            "php -r \"copy('.env.example', '.env');\"",
            "php artisan key:generate"
        ]
    },
    "config": {
        "preferred-install": "dist"
    }
}

我已经运行composer update以确保我拥有最新的依赖项,但我仍然遇到同样的错误。有什么想法吗?

编辑:我使用的是PHP 5.4

编辑2:通过php artisan serve运行时有效,但在使用我的运行apache的开发箱为网站提供服务时却无效。所以它可能是那个盒子上的本地php问题。

1 个答案:

答案 0 :(得分:0)

我认为此问题与您的本地服务器设置有关。我在本地服务器上遇到了同样的问题,并在php.ini中设置了date.timezone值