Could not open input file: artisan

后端 未结 27 924
清歌不尽
清歌不尽 2020-11-30 17:45

When trying to create a new laravel project, The following error appears on the CLI:

Could not open input file: artisan

Script php artisan clear-c

相关标签:
27条回答
  • 2020-11-30 18:06

    Check the directory in CMD console, it should be the same as the project .

    C:\...project directory
    

    or

    D:\...project directory
    
    0 讨论(0)
  • 2020-11-30 18:07

    What did the trick for me was to do cd src from my project directoy, and then use the php artisan command, since my artisan file was in the src folder. Here is my project structure:

    project
    |__ config
    |__ src
        |__ app
        |__ ..
        |__ artisan  // hello there!
        |__ ...
    |__ ...
    
    0 讨论(0)
  • 2020-11-30 18:12

    If you project is at /home/forge/laravel-project/

    You can properly execute your artisan like this

    php /home/forge/laravel-project/artisan ...

    0 讨论(0)
  • 2020-11-30 18:12

    First create the project from the following link to create larave 7 project: Create Project

    Now you need to enter your project folder using the following command:

    cd myproject
    

    Now try to run artisan command, such as, php artisan.

    Or it may happen if you didn't install compose. So if you didn't install composer then run composer install and try again artisan command.

    0 讨论(0)
  • 2020-11-30 18:12

    You need to first create Laravel project and if you already have one you need to go to this project dir using cd command in terminal for example cd myproject.

    Example : C:\xampp new\htdocs\project laravel\LaravelProject>php artisan serve

    Now you will be able to run any artisan commands, for example running php artisan will display you list of available commands.

    0 讨论(0)
  • 2020-11-30 18:13

    You cannot use php artisan if you are not inside a laravel project folder.

    That is why it says 'Could not open input file - artisan'.

    0 讨论(0)
提交回复
热议问题