php artisan command doesn't work

  • | 805 points

    I went to my project folder, where I can see the file artisan and then entered the command "php artisan" and got this error message:

    {"error":{"type":"Symfony\\Component\\Debug\\Exception\\FatalErrorException","message":"Uncaught TypeError: Argument 1 passed to Illuminate\
    \Exception\\WhoopsDisplayer::display() must be an instance of Exception, instance of Error given, called in C:\\laragon\\www\\larabook\\boot
    strap\\compiled.php on line 9462 and defined in C:\\laragon\\www\\larabook\\bootstrap\\compiled.php:9352\nStack trace:\n#0 C:\\laragon\\www\
    \larabook\\bootstrap\\compiled.php(9462): Illuminate\\Exception\\WhoopsDisplayer->display(Object(Error))\n#1 C:\\laragon\\www\\larabook\\boo
    tstrap\\compiled.php(9414): Illuminate\\Exception\\Handler->displayException(Object(Error))\n#2 C:\\laragon\\www\\larabook\\bootstrap\\compi
    led.php(9418): Illuminate\\Exception\\Handler->handleException(Object(Error))\n#3 [internal function]: Illuminate\\Exception\\Handler->handl
    eUncaughtException(Object(Error))\n#4 {main}\n  thrown","file":"C:\\laragon\\www\\larabook\\bootstrap\\compiled.php","line":9352}}

    I am assuming the command work, but for some reason, I can't run the file. I installed a project using laragon by clicking quick install. I installed version 4.2.

    Doing ls gives me the following:  app/  artisan*  bootstrap/  composer.json  composer.lock  phpunit.xml  public/  server.php  vendor/     

    I get the homepage when I go to, so it seems everything is fine.

    Before that, I entered "composer require way/generators --dev" and it seemed to work fine, I then added 'Way\Generators\GeneratorsServiceProvider' to the app file as a provider.

  • | 486 points

    Switch PHP versions from 7 to 5. And then you should see the real error.

  • | 69 points

    I would try php artisan optimize

Log in to reply

Looks like your connection to Laragon was lost, please wait while we try to reconnect.