Nic*_*ore 12 php namespaces laravel psr-4
我试图接受一年后在学校开发的laravel项目,我遇到了一些问题.在我的托管服务的服务器上上传整个项目后,我在浏览器和SSH shell上都出现了这些错误.
致命错误:/home/clients/ffa41f94063541f86a0fe6602a73caa1/myforms/vendor/laravel/framework/src/Illuminate/Container/Container.php:779未捕获的异常'ReflectionException',消息'Class App\Http\Kernel'不存在'堆栈跟踪:#0 /home/clients/ffa41f94063541f86a0fe6602a73caa1/myforms/vendor/laravel/framework/src/Illuminate/Container/Container.php(779):ReflectionClass - > __ construct('App\Http\Kernel')#1/home/clients /ffa41f94063541f86a0fe6602a73caa1/myforms/vendor/laravel/framework/src/Illuminate/Container/Container.php(659):Illuminate\Container\Container-> build('App\Http\Kernel',Array)#2/home/clients/ffa41f94063541f86a0fe6602a73caa1/myforms/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(644):Illuminate\Container\Container-> make('App\Http\Kernel',Array)#3/home/clients/ffa41f94063541f86a0fe6602a73caa1 /myforms/vendor/laravel/framework/src/Illuminate/Container/Container.php(229):Illuminate\Foundation\Application-> make('App\Http\Kernel',Array)位于779行的/home/clients/ffa41f94063541f86a0fe6602a73caa1/myforms/vendor/laravel/framework/src/Illuminate/Container/Container.php中的#4/home/clients/ffa41f94063
我认为它可能与我的命名空间配置有关,因为我还没有完全理解.
这是我的composer.json文件:
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"laravel/framework": "5.0.*",
"illuminate/html": "5.*",
"barryvdh/laravel-dompdf": "0.5.*",
"guzzlehttp/guzzle": "~4.0"
},
"require-dev": {
"phpunit/phpunit": "~4.0",
"phpspec/phpspec": "~2.1"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "myforms/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"
}
}Run Code Online (Sandbox Code Playgroud)
我已经做了什么:
composer installcomposer dump-autoloadcomposer update
顺便说一句,我插入时出错 composer update如果我应该发布另一个可能有用的文件,请通知我.
在此先感谢您的帮助.
Rog*_*asy 18
在composer.json中更改:
"psr-4": {
"App\\": "myforms/app/"
}
Run Code Online (Sandbox Code Playgroud)
至:
"psr-4": {
"App\\": "app/"
}
Run Code Online (Sandbox Code Playgroud)
在服务器上,在你的源代码目录,运行composer update再composer dump-autoload
Laravel中的PSR-4查找相对于项目根目录的命名空间
| 归档时间: |
|
| 查看次数: |
15241 次 |
| 最近记录: |