Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

affaqgill's avatar

Php artisan serve

I installed a fresh laravel 6

When I run php artisan serve on my terminal to start the server. I find the error below

[PHP Warning: require(C:\xampp\htdocs\untyme/vendor/autoload.php): failed to open stream: No such file or directory in C:\xampp\htdocs\untyme\artisan on line 18

Warning: require(C:\xampp\htdocs\untyme/vendor/autoload.php): failed to open stream: No such file or directory in C:\xampp\htdocs\untyme\artisan on line 18 PHP Fatal error: require(): Failed opening required 'C:\xampp\htdocs\untyme/vendor/autoload.php' (include_path='\xampp\php\PEAR') in C:\xampp\htdocs\untyme\artisan on line 18

Fatal error: require(): Failed opening required 'C:\xampp\htdocs\untyme/vendor/autoload.php' (include_path='\xampp\php\PEAR') in C:\xampp\htdocs\untyme\artisan on line 18]

0 likes
20 replies
affaqgill's avatar

composer is intalled already I've installed my project using composer

affaqgill's avatar

I've even tried php -S localhost:8000 -t public/

jlrdw's avatar

What do you see if you just run php artisan

Should be list of artisan commands.

Usage:
  command [options] [arguments]

Options:
  -h, --help            Display this help message
  -q, --quiet           Do not output any message
  -V, --version         Display this application version
      --ansi            Force ANSI output
      --no-ansi         Disable ANSI output
  -n, --no-interaction  Do not ask any interactive question
      --env[=ENV]       The environment the command should run under
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Available commands:
  clear-compiled       Remove the compiled class file
  down                 Put the application into maintenance mode
  env                  Display the current framework environment
  help                 Displays help for a command
  inspire              Display an inspiring quote
  list                 Lists commands
//////MORE
affaqgill's avatar

As you people said I've run (Composer install)

But still I got the same error

jlrdw's avatar

In your project folder, is the vendor folder there.

jlrdw's avatar

In the folder do you see

app
bootstrap
config
///more
affaqgill's avatar

app bootstrap config database node_modules public resources routes storage tests

I've these directories

affaqgill's avatar

I tried to install npm but that didn't solved the problem

jlrdw's avatar

At command line in your project folder, copy and paste this:

composer install

And hit enter

jlrdw's avatar

If it doesn't work just enter composer then hit enter, make sure composer is working.

Composer alone should display composer commands.

During install of composer, you should have told it where php is, maybe reinstall composer.

affaqgill's avatar

After running the the command I got this

Loading composer repositories with package information Updating dependencies (including require-dev)

[ErrorException] "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?

install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimi ze-autoloader] [-a|--classmap-authoritative] [--ignore-platform-reqs] [--] []...

And php artisan is still not working

affaqgill's avatar

I installed the composer again! Should I create the project again?

Cronix's avatar

run php -v from your terminal. What version of php are you using for the cli?

affaqgill's avatar

@cronix php version is 7.3.5

PHP 7.3.5 (cli) (built: May 1 2019 13:17:17) ( ZTS MSVC15 (Visual C++ 2017) x64 ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.3.5, Copyright (c) 1998-2018 Zend Technologies

affaqgill's avatar

After re installing composer I created a new laravel project and this time php artisan do result in lists of command and server successfully initiated while I run the command

php -S localhost:8000 -t public/

Please or to participate in this conversation.