使用 MAMP 在 OSX 上安装 composer

编程入门 行业动态 更新时间:2024-10-28 12:31:12
本文介绍了使用 MAMP 在 OSX 上安装 composer的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试使用 MAMP 在 OSX 上安装 composer 并使用了 本指南,但是它似乎不起作用.

I'm trying to install composer on OSX with MAMP and have used this guide, but it doesn't seem to be working.

在最后一步我收到以下错误:

On the final step I get the following error:

mv: rename composer.phar to /usr/local/bin/composer: No such file or directory

有谁知道可能出了什么问题?我正在使用 OSX 10.9.5 和 MAMP 3.0.7.3 和 PHP 版本 5.6.2.

Does anyone know what could be wrong? I'm using OSX 10.9.5 and MAMP 3.0.7.3 and PHP version 5.6.2.

推荐答案

下载 composer.phar 并将其保存到您的项目文件夹中:getcomposer/composer.phar

Download composer.phar and save it into your project folder: getcomposer/composer.phar

然后打开你的终端并输入:

Then open your terminal and type:

nano ~/.bash_profile

文件打开后,输入以下代码

Once the file is open, enter the following code

alias composer='php ~/composer.phar' export PATH=/Applications/MAMP/bin/php/php7.0.10/bin:$PATH

请注意,我目前正在使用 php7.0.10 版本.只需使用您正在使用的 php 版本自定义上面的代码.

Please note that I am currently working with php7.0.10 version. Just customize the code above with the php version you're working with.

ctrl+o 保存文件ctrl+m 确认格式ctrl+x 关闭文件

ctrl+o to save the file ctrl+m to confirm format ctrl+x to close the file

现在重新加载配置文件

source ~/.bash_profile

提示 composer 以检查是否正常工作

Tipe composer in order to check if is working

______ / ____/___ ____ ___ ____ ____ ________ _____ / / / __ / __ `__ / __ / __ / ___/ _ / ___/ / /___/ /_/ / / / / / / /_/ / /_/ (__ ) __/ / \____/\____/_/ /_/ /_/ .___/\____/____/\___/_/ /_/ Composer version 1.2.2

如果上面的文字显示了,那么你就可以开始了!

if the text above is shown, then you're ready to go!

更多推荐

使用 MAMP 在 OSX 上安装 composer

本文发布于:2023-10-20 01:01:22,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1509360.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:MAMP   OSX   composer

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!