Mastertech01's avatar

php artisan error(failed to open stream: No such file or directory)

hello everyone, I am cloning a project on Github, I followed the tutorial steps listed bellow

clone the repo

$ git clone https://github.com/coreui/coreui-free-laravel-admin-template.git my-project

go into app's directory

$ cd my-project

install app's dependencies

$ composer install

install app's dependencies

$ npm install

the above stages were successful and I have connected the .env to myql database

the next stage which is

in your app directory

generate laravel APP_KEY

$ php artisan key:generate

i have tried everything possible to pass this stage is showing me error. i have use composer update, composer dumpautoload still giving me same error.. this the error message ODUMS@ODUM MINGW64 /c/_project/web/prediction (master) $ php artisan

Warning: require(C:_project\web\prediction/vendor/autoload.php): failed to open stream: No such file or directory in C:_project\web\prediction\artisan on line 18

Fatal error: require(): Failed opening required 'C:_project\web\prediction/vendor/autoload.php' (include_path='.;C:\php\pear') in C:_project\web\prediction\artisan on line 18

I also included the (include_path='.;C:\php\pear) in artisan file still giving me error

how will I resolve....

0 likes
5 replies
neilstee's avatar

@mastertech01 looks like your composer install wasn't successful at all.

require(C:_project\web\prediction/vendor/autoload.php): failed to open stream: No such file or directory in C:_project\web\prediction\artisan on line 18 this error means you don't have the vendor/autoload.php which can be only generated via composer.

Are you sure you are in the correct directory?

neilstee's avatar

@mastertech01 you might think that your composer install was a success but wasn't mainly because your PHP version is not compatible?

On this package, it requires PHP 7.2.5.

Check your PHP version first.

1 like
Mastertech01's avatar

Thanks, i have upgraded my php version to 7.4.13 because its one of the requirement to install laravel 8 and also updated composer to 2.0.8, respectively it was successful but still getting the same error

mcangueiro's avatar

Something doesn't feel right with your paths.

Looking at this it seems you are on a Windows machine and the paths seem to be missing a slash just after the colon.

C:_project\web\prediction/vendor/autoload.php

This is not a valid path, there's a slash missing as I said.

samir20-23's avatar

the problem is error:

ext xml

ext dom

fix : open new terminal and run this : [

sudo apt update
sudo apt install php-xml
php -m | grep -E "xml|dom" 

] open laravel project in terminal and run : [

composer install

] now boom is fexed you can see the folder /vendor now .

Please or to participate in this conversation.