Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to install Composer - php-fpm

Finally got Ubuntu 12.10 with nginx and php-fpm up and running. Now I want to run a websocket server with Ratchet, but I need to install Composer first. So I do this:

 curl -s https://getcomposer.org/installer | php

Just as the Composer site instructed, but I received the following error:

The program 'php' is currently not installed.

I thought it might have something to do with the php at the end there so I changed it to php5-fpm and then it told me:

[18-Nov-2012 05:01:30] ERROR: An another FPM instance seems to already listen on /var/run/php5-fpm.sock
[18-Nov-2012 05:01:30] ERROR: FPM initialization failed

Has anyone else encountered this? Any solutions? Thanks.

like image 497
jreed121 Avatar asked Nov 18 '12 13:11

jreed121


People also ask

Why is composer not installing?

Try clearing Composer's cache by running composer clear-cache . Ensure you're installing vendors straight from your composer. json via rm -rf vendor && composer update -v when troubleshooting, excluding any possible interferences with existing vendor installations or composer.

Do you need PHP to install composer?

Important! If you installed Composer locally, you need to use php composer. phar command within the same directory where it was installed in order to use Composer.

Can composer install PHP?

Installation PHP composer on Windows:Step 1: Navigate to the official composer website. Step 2: Then click on the Download button. Step 3: Then click on the Composer-Setup.exe & download the file. Step 4: Then click on “Install for all users”.

How do you check the composer is installed or not?

You can check your installed composer version using a command composer -v at the current path. Such as: composer -v.


2 Answers

composer needs at least php 5.3.2. what's your php version? You need php command line to make it work. As the error msg suggested, you'd better install 'php'. In ubuntu, you can use

  sudo apt-get install php5-cli
like image 110
Chuan Ma Avatar answered Sep 28 '22 05:09

Chuan Ma


use

usr/bin/php or /usr/bin/php instead of php

if you are not sure where your php is located, do a check via

whereis php
like image 33
George Avatar answered Sep 28 '22 05:09

George