Are you running this in the root of your project?
php artisan migrate
when im trying to run the php artisan migrate command in cmd i am getting: Could not open input file: artisan
kindly assist
yes i figured that out and now im getting this error
C:\Users\mzahr\blog>php artisan migrate PHP Fatal error: Class 'Illuminate\Foundation\Application' not found in C:\Users\mzahr\blog\bootstrap\app.php on line 14
Fatal error: Class 'Illuminate\Foundation\Application' not found in C:\Users\mzahr\blog\bootstrap\app.php on line 14
run composer dump-autoload
i tried it and resulted into another error : Generating optimized autoload files Class Illuminate\Foundation\ComposerScripts is not autoloadable, can not call post-autoload-dump script
@php artisan package:discover
Fatal error: Class 'Illuminate\Foundation\Application' not found in C:\Users\mzahr\blog\bootstrap\app.php on line 14 PHP Fatal error: Class 'Illuminate\Foundation\Application' not found in C:\Users\mzahr\blog\bootstrap\app.php on line 14 Script @php artisan package:discover handling the post-autoload-dump event returned with error code 255
@mariona19 Remove the vendor folder and composer.lock and run command:
composer install
that should fix the problem
Whenever you clone a project, you need to install the dependencies. So your typical steps will be first composer install and then php artisan migrate
@rin4ik it updated the dependencies but when i tried php aritsan migrate again i got the same error PHP Warning: require(C:\Users\mzahr\blog/vendor/autoload.php): failed to open stream: No such file or directory in C:\Users\mzahr\blog\artisan on line 18
Warning: require(C:\Users\mzahr\blog/vendor/autoload.php): failed to open stream: No such file or directory in C:\Users\mzahr\blog\artisan on line 18 PHP Fatal error: require(): Failed opening required 'C:\Users\mzahr\blog/vendor/autoload.php' (include_path='C:\xampp\php\PEAR') in C:\Users\mzahr\blog\artisan on line 18
Fatal error: require(): Failed opening required 'C:\Users\mzahr\blog/vendor/autoload.php' (include_path='C:\xampp\php\PEAR') in C:\Users\mzahr\blog\artisan on line 18
@mariona19 that's strange try again composer dump-autoload
Did the composer install step complete fully without errors? It should have created the autoload files, but you can do this using composer dump-autoload
@rin4ik another error Generating optimized autoload files Class Illuminate\Foundation\ComposerScripts is not autoloadable, can not call post-autoload-dump script
@php artisan package:discover
Fatal error: Class 'Illuminate\Foundation\Application' not found in C:\Users\mzahr\blog\bootstrap\app.php on line 14 PHP Fatal error: Class 'Illuminate\Foundation\Application' not found in C:\Users\mzahr\blog\bootstrap\app.php on line 14 Script @php artisan package:discover handling the post-autoload-dump event returned with error code 255
in public/index.php file you have these lines?
require __DIR__.'/../vendor/autoload.php';
/*
|--------------------------------------------------------------------------
| Turn On The Lights
|--------------------------------------------------------------------------
|
| We need to illuminate PHP development, so let us turn on the lights.
| This bootstraps the framework and gets it ready for use, then it
| will load up this application so that we can run it and send
| the responses back to the browser and delight our users.
|
*/
$app = require_once __DIR__.'/../bootstrap/app.php';
one question just to make sure how can i update my php from the cmd becuase i think i have an old version which is not compatible
@mariona19 I don't think that it's related to php version. please check this in your routes/web.php file to know your current php version:
Route::get('phpinfo', function () {
phpinfo();
});
check in browser domain.test/phpinfo
check first you have artisan file in your root directory.
coming from google, burner account just to answere here. nobody seemed to notice they had this path specified:
C:\Users\mzahr\blog/vendor/autoload.php
they are obviously on xampp, and the path can NEVER work when trying to match unix/path/style to a windows\path\style
Please or to participate in this conversation.