我通过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问题。
答案 0 :(得分:0)
我认为此问题与您的本地服务器设置有关。我在本地服务器上遇到了同样的问题,并在php.ini中设置了date.timezone值