3
votes

I'm new to Laravel ad i have just created new project using official laravel documentation.

After installing when i run php artisan migrate it will showing

Could not open input file: artisan error in console

Listing of commands that i run

  1. composer create-project --prefer-dist laravel/laravel laravelDemo

    which will create new folder laravelDemo

  2. cd laravelDemo

  3. php artisan migrate

I'm using Ubuntu 16.04

I have already checked possible duplicate answer but i have installed it throw composer.

Please help Thanks in Advance :)

3
@Tiger yes i already checked that answer but i have download it from composer as you can see my commands that i run. - Binit Ghetiya
Are you in your project directory ? - TIGER
@Tiger yes please look second step. - Binit Ghetiya
run this command composer update --no-scripts - TIGER
@Tiger still the same issue - Binit Ghetiya

3 Answers

1
votes

Not figure out what actual problem is but what i did is deleted laravelDemo folder and run above command and it worked.

i have also tried composer update --no-scripts which will updated all the composer dependencies successfully.

May be there were some issue in installing the project.

1
votes

check that the project contains the artisan file, it's a php.

<?php

define('LARAVEL_START', microtime(true));

require __DIR__.'/vendor/autoload.php';

$app = require_once __DIR__.'/bootstrap/app.php';



$kernel = $app->make(Illuminate\Contracts\Console\Kernel::class);

$status = $kernel->handle(
    $input = new Symfony\Component\Console\Input\ArgvInput,
    new Symfony\Component\Console\Output\ConsoleOutput
);


$kernel->terminate($input, $status);

exit($status);`
0
votes

The problem is you type the command out of laravelDemo folder. please go into this folder by running: cd laravelDemo and try again.