简体   繁体   English

Composer 未安装在 Windows 机器上

[英]Composer not installing on windows machine

I am very new to web development and mostly following tutorials so, I am learning laravel and I want to install composer.我对 Web 开发很陌生,主要是在学习教程,所以我正在学习 Laravel,我想安装 Composer。 I downloaded the setup from the composer website and manually added the PHP path in environment variable I am using xampp.我从 Composer 网站下载了设置,并在我使用的 xampp 环境变量中手动添加了 PHP 路径。 when I run the installer I get this error当我运行安装程序时出现此错误

"The Composer installer script did not run correctly because composer.phar was not downloaded." “Composer 安装程序脚本未正确运行,因为未下载 composer.phar。”

error screenshot错误截图

2 ways you could fix it, 2种方法可以修复它,

  1. Run the following command in the cmd:在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)卸载然后重新安装并以管理员身份运行(如果您使用的是 Windows,请运行 .exe)

The first one fixed mine once.第一个固定我的一次。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM