doutao1282 2016-09-17 15:41
浏览 316

在终端中调用composer.phar时,获取“无法打开输入文件:composer.phar”

I am working on a PHP development project that includes Composer. I am relatively new at this so I thank you in advance for your patience with my question, and ask that you reply in as simple of language as possible.

I am trying to run the following command in terminal:

php composer.phar dump-autoload -o

I am getting the following error:

Could not open input file: composer.phar

This is the file path to my composer.phar folder: /Users/administrator/Dropbox/2016/2016ProjectFiles/2016ProjectsWeb/GG/authentication/composer.phar

I have tried several ways to provide the file path, including the following:

$cd /Users/administrator/Dropbox/2016/2016ProjectFiles/2016ProjectsWeb/GG/authentication/composer.phar dump-autoload -o

...and...

$cd ../authentication/composer.phar dump-autoload -o

It is entirely possible/likely that my syntax is wrong or there is a stupid simple solution that I just don't know. I just need to be able to run file commands on composer.phar from terminal. Any help is much appreciated!

  • 写回答

3条回答 默认 最新

  • duanmeng1858 2016-09-17 16:58
    关注

    You have downloaded composer.phar file successfully. Great job. Now the second steps is to make ti globally accessible like php or git.

    This article about installing composer in Mac describe as follows:

    Quoting Running Composer section

    Run commads:

    sudo mv composer.phar /usr/local/bin/
    vim ~/.bash_profile
    

    Now add to .bash_profile:

    alias composer="php /usr/local/bin/composer.phar"
    

    And you're done.

    Run composer anywhere you need.

    评论

报告相同问题?

悬赏问题

  • ¥15 有人能看一下我宿舍管理系统的报修功能该怎么改啊?链表那里总是越界
  • ¥15 cs loadimage运行不了,easyx也下了,没有用
  • ¥15 r包runway详细安装教程
  • ¥15 Html中读取Json文件中数据并制作表格
  • ¥15 谁有RH342练习环境
  • ¥15 STM32F407 DMA中断问题
  • ¥15 uniapp连接阿里云无法发布消息和订阅
  • ¥25 麦当劳点餐系统代码纠错
  • ¥15 轮班监督委员会问题。
  • ¥20 关于变压器的具体案例分析