PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, December 31, 2021

[FIXED] Couldn't create laravel project with composer (version 2.1.4)

 December 31, 2021     composer-php, php     No comments   

Issue

I'm trying to create a laravel project with composer and when I run

composer create-project laravel/laravel example-app

in the terminal, the process stops with the following error:

[RuntimeException]
php: does not exist and could not be created.

I have php 7.4 running through Wampserver and I've added it's PATH to the environment variables and when I run php -v in the terminal, everything seems fine:

PHP 7.4.0 (cli) (built: Nov 27 2019 10:14:18) ( ZTS Visual C++ 2017 x64 )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies

what am I missing here? I'm using composer version 2.1.4 and running the command in administrative mode didn't make a difference neither.

screenshot of running commands on the command-line


Solution

Update to version 2.1.5 of Composer by running this command:

composer self-update

This was a bug that has since been fixed. It was attempting to create a directory called php: which is not possible on Windows systems.



Answered By - miken32
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing