WebFaction
Community site: login faq

I am currently trying to make the php command run a version 5.5 or later of php. I've added this to my .bash_profile file:

alias php="/usr/local/bin/php55

...and it works.

However, I get an error when running composer that says:

"Warning: Composer should be invoked via the CLI version of PHP, not the cgi-fcgi SAPI"

Is there any way I can make an alias for the CLI version.

asked 12 Jan '16, 06:02

thexyzaffair's gravatar image

thexyzaffair
112
accept rate: 0%


You should be able to install composer using the following instructions:

curl -sS https://getcomposer.org/installer | php56

In order to avoid any issues down the line:

cd ~/bin
ln -s /usr/local/bin/php56 php

Modify your ~/.bash_profile file and change:

PATH=$PATH:$HOME/bin

To:

PATH=$HOME/bin:$PATH

Then close your SSH session and start a new one, or run:

source ~/.bash_profile

The ~/bin path will then take precedence and you will be using the correct version of PHP.

permanent link

answered 12 Jan '16, 08:31

dimitari's gravatar image

dimitari
2215
accept rate: 36%

edited 27 Oct, 16:50

maryh's gravatar image

maryh ♦♦
1.3k6

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×253

question asked: 12 Jan '16, 06:02

question was seen: 2,423 times

last updated: 27 Oct, 16:50

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2017 PARAGON INTERNET GROUP LIMITED
WEBFACTION IS A SERVICE OF PARAGON INTERNET GROUP LIMITED
REGISTERED IN ENGLAND AND WALES 7573953 - VAT REGISTRATION NUMBER 182147021
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM