0
votes

I am new in laravel development,actually i tried to setup laravel in my local environment of windows. I installed composer in my C:// drive, created environment variable for composer, but when I C:\xampp\htdocs>composer create-project laravel/laravel laravel_new run this command in htdocs it shows error like:

[InvalidArgumentException]
Composer could not find the config file: C:\composer
To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting S tarted" section

also when I tried php artisan serve

C:\xampp\htdocs\laravel_new>php artisan serve

PHP Warning: require(C:\xampp\htdocs\laravel_new/vendor/autoload.php): Failed to open stream: No such file or directory in C:\xampp\htdocs\laravel_new\artisan on line 18
Warning: require(C:\xampp\htdocs\laravel_new/vendor/autoload.php): Failed to open stream: No such file or directory in C:\xampp\htdocs\laravel_new\artisan on line 18
PHP Fatal error: Uncaught Error: Failed opening required 'C:\xampp\htdocs\laravel_new/vendor/autoload.php' (include_path='C:\xampp\php\PEAR') in C:\xampp\htdocs\laravel_new\artisan:18
Stack trace:
#0 {main} thrown in C:\xampp\htdocs\laravel_new\artisan on line 18
Fatal error: Uncaught Error: Failed opening required 'C:\xampp\htdocs\laravel_new/vendor/autoload.php' (include_path='C:\xampp\php\PEAR') in C:\xampp\htdocs\laravel_new\artisan:18
Stack trace:
#0 {main} thrown in C:\xampp\htdocs\laravel_new\artisan on line 18

it shows error like above. What should I do to complete my setup?

1
Check composer installed or not ? Check by terminal using command composer ? - Al-Amin Sarker
yes composer installed properly i checked - chirag_parmar
I think your composer install is not properly. Uninstall then install composer again - A.A Noman
The error message of composer says that it can not find your composer.json file. Could you check if the laravel installer has created one for you? If so, run composer install in your project path. If that does not fail, php atrisan should work. - Daantje
If you're new to Laravel and other tools it depends on, my advice is to Google for the "Laragon" project if you want pure Windows environment, but (IMHO) the best is "Laradock.io" if you're ok with WSL+Docker. With that you'll have a container named "workspace" with all the tools you need for a Laravel project. I'm using it for years and it's a life saver. Trust me... - ARS81

1 Answers

0
votes

Probably you did something wrong when you install your xampp,composer,so what you have to do is uninstall xampp and install last version (add php to your path environment) and uninstall your composer and download last version and install it globally