Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationEventAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
1
Help us understand the problem. What are the problem?

More than 3 years have passed since last update.

@owlbeck

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

条件

手順

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
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
1
Help us understand the problem. What are the problem?