Home » Php » php – Composer not installing on windows machine

php – Composer not installing on windows machine

Posted by: admin February 25, 2020 Leave a comment


I am very new to web development and mostly following tutorials so, I am learning laravel and I want to install composer. I downloaded the setup from the composer website and manually added the PHP path in environment variable I am using xampp. when I run the installer I get this error

“The Composer installer script did not run correctly because composer.phar was not downloaded.”

error screenshot

How to&Answers:

2 ways you could fix it,

  1. Run the following command in the cmd:

    php -r "eval('?>'.file_get_contents('http://getcomposer.org/installer'));"

  2. Uninstall and then re-install and run as administrator(run the .exe if you’re on windows)

The first one fixed mine once.