5
1

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.

レンタルサーバーの「Value Server」でComposerを利用する方法

Last updated at Posted at 2017-07-11

条件

手順

Composerは標準でインストールされているが、そのまま実行するとエラーが出る。

$ composer

You are running composer with xdebug enabled. This has a major impact on runtime performance. See https://getcomposer.org/xdebug

                                           
  [ErrorException]                         
  Invalid argument supplied for foreach()  
                                           

CLI版から実行すると動作する。

$ which composer
/usr/bin/composer

php5.6

$ php56cli /usr/bin/composer

You are running composer with xdebug enabled. This has a major impact on runtime performance. See https://getcomposer.org/xdebug
   ______
  / ____/___  ____ ___  ____  ____  ________  _____
 / /   / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
/ /___/ /_/ / / / / / / /_/ / /_/ (__  )  __/ /
\____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
                    /_/
Composer version 1.0-dev (f25446e507a3f420b2b88e6dedc47787d42ea7e9) 2015-12-15

php7.1

$ php71cli /usr/bin/composer
   ______
  / ____/___  ____ ___  ____  ____  ________  _____
 / /   / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
/ /___/ /_/ / / / / / / /_/ / /_/ (__  )  __/ /
\____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
                    /_/
Composer version 1.0-dev (f25446e507a3f420b2b88e6dedc47787d42ea7e9) 2015-12-15

Composerのバージョンを最新にする

標準でインストールされているものはバージョンが古いため、最新版にしたい場合はダウンロード
する。

$ curl -sS https://getcomposer.org/installer | php71cli

All settings correct for using Composer
Downloading...

Composer (version 1.4.2) successfully installed to: /virtual/culture24/composer.phar
Use it: php composer.phar

最新版を実行してみる。

$ php71cli composer.phar

   ______
  / ____/___  ____ ___  ____  ____  ________  _____
 / /   / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
/ /___/ /_/ / / / / / / /_/ / /_/ (__  )  __/ /
\____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
                    /_/
Composer version 1.4.2 2017-05-17 08:17:52

.bashrcへエイリアスを登録してcomposerコマンドで利用可能とする。

$ vi .bashrc

#追記
alias composer='php71cli ~/composer.phar'

$ source ./.bashrc
5
1
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
5
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?