![](/img/trans.png)
[英]Debugging Laravel with Xdebug in IntelliJ IDEA/PhpStorm with artisan serve command
[英]Laravel debugging issues in phpstorm + xdebug
我希望我能在這里得到一些幫助。
我對於在phpstorm中進行調試非常陌生。 作為php框架,我使用XAMPP上安裝的Laravel。 只是為了演示我的問題,我指的是全新laravel安裝的基本代碼。
當前狀態如下:
我嘗試調試例如routes.php,其中開箱即用僅包含以下內容:
Route::get('/', function() {
return View::make('hello'); });
對於“ Route”別名,我得到一個錯誤:
致命錯誤:找不到類“ Route”
我希望xdebug進行調試沒有問題,因為在我的項目的根目錄中有_ide_helper.php,並且因為我可以單擊所有別名的façades等等。->從類到類都沒有任何問題。
laravel框架的所有其他類同樣適用,例如“ HomeController”
class HomeController extends BaseController {
在調試控制台中出現相同錯誤的地方:
致命錯誤:找不到類“ BaseController”
對我來說,測試/調試我的控制器等並不遙遠,所以如果我能以某種方式使它工作,我會很高興。
希望大家知道如何解決這個問題:)預先感謝!
編輯
這是composer.json
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"require": {
"laravel/framework": "4.2.*",
"phpunit/phpunit": "4.1.*",
"barryvdh/laravel-ide-helper": "1.*"
},
"autoload": {
"classmap": [
"app/commands",
"app/controllers",
"app/models",
"app/database/migrations",
"app/database/seeds",
"app/tests/TestCase.php"
]
},
"scripts": {
"post-install-cmd": [
"php artisan clear-compiled",
"php artisan optimize",
"bower install"
],
"post-update-cmd": [
"php artisan clear-compiled",
"php artisan ide-helper:generate",
"php artisan optimize",
"bower install"
],
"post-create-project-cmd": [
"php artisan key:generate"
]
},
"config": {
"preferred-install": "dist"
},
"minimum-stability": "stable"}
我也嘗試了“ composer dumpautoload”,但沒有成功。
謝謝你的努力!
當我看到您的錯誤時,我懷疑是自動加載錯誤。 您可以張貼您的composer.json嗎?
我想對此發表評論,但我還不能。 如果找到解決方法,我將只編輯此答案。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.