22
23

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

macにcomposerをinstallするまでのあれこれ

Last updated at Posted at 2014-02-26

こちらのinstallに従って実行

$ curl -sS https://getcomposer.org/installer | php
#!/usr/bin/env php
Some settings on your machine make Composer unable to work properly.
Make sure that you fix the issues listed below and run this script again:

The detect_unicode setting must be disabled.
Add the following to the end of your `php.ini`:
    detect_unicode = Off

A php.ini file does not exist. You will have to create one.
If you can not modify the ini file, you can also run `php -d option=value` to modify ini values on the fly. You can use -d multiple times.

php.iniがないよ。ない形で実行するのであれば、detect_unicode = Offこんな感じで実行してねという意味だと受け取った!

↑のサイトにもそのような事が書いてあったので実行してみる。

$ curl -sS https://getcomposer.org/installer | php -d detect_unicode = Off
Could not open input file: =
curl: (23) Failed writing body (0 != 1674)

何が起きたんだ。。。
参考サイトをよく見るとオプションが間違っていた。
curl -sScurl -sでした。。。

$ curl -s getcomposer.org/installer | php -d detect_unicode=Off
#!/usr/bin/env php
All settings correct for using Composer
Downloading...

Composer successfully installed to: /Users/mapyo/vagrant/cmsp/cmsp-admin/composer.phar
Use it: php composer.phar

という事で無事に入りました。

↑のサイトを参考に扱い易いようにパスの通ったところに移動させてみます。

$ mv ./composer.phar /usr/local/bin/                       
$ ln -s /usr/local/bin/composer.phar /usr/local/bin/composer

参考サイトではcomposer.pharのファイル名をそのまま書きかえてましたが、
それだと忍びないのでシンボリックリンクを貼る形にしてみました。

$ composer
   ______
  / ____/___  ____ ___  ____  ____  ________  _____
 / /   / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
/ /___/ /_/ / / / / / / /_/ / /_/ (__  )  __/ /
\____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
                    /_/

めでたしめでたし!

22
23
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
22
23

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?