Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

having trouble installing composer

I am installing composer with the following cammand

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

But I am keep getting below error message

Zafars-MacBook-Pro:etc zafarsaleem$ curl -s 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. 

How can I install composer be removing above error?

EDIT

Zafars-MacBook-Pro:etc zafarsaleem$ php --ini Configuration File (php.ini) Path: /etc Loaded Configuration File:         (none) Scan for additional .ini files in: (none) Additional .ini files parsed:      (none) 

Latest Edit

After some research I found that php.ini file which is being used is in /etc/php.ini. However, when I checked this file in /etc folder it wasn't there. /etc folder contained php.ini.default folder which linked to /private/etc/php.ini.default. So I added detect_unicode = Off in /etc/php.ini.default and the renamed this file to php.ini. Now when I execute below command

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

OR

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

Then I get following errors

Zafars-MacBook-Pro:/ zafarsaleem$ sudo curl -s https://getcomposer.org/installer | php #!/usr/bin/env php All settings correct for using Composer Downloading... Download failed: failed to open stream: Permission denied Downloading... Download failed: failed to open stream: Permission denied Downloading... Download failed: failed to open stream: Permission denied The download failed repeatedly, aborting. 

How can I install composer on my computer and remove above problems? Please help

like image 799
Om3ga Avatar asked Jan 21 '13 11:01

Om3ga


People also ask

How do I manually install a composer?

Installation - Windows# This is the easiest way to get Composer set up on your machine. Download and run Composer-Setup.exe. It will install the latest Composer version and set up your PATH so that you can call composer from any directory in your command line. Note: Close your current terminal.


2 Answers

To download / install on MacOSX, you can do the following steps or try the homebrew steps below:

  1. Goto a directory you can write to:

    cd ~

  2. get composer:

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

  3. move composer into a bin directory in your $PATH var:

    sudo mv composer.phar /usr/local/bin/composer

  4. double check composer works

    composer about

  5. (optional) Update composer:

    sudo composer self-update

Homebrew

brew update brew tap homebrew/homebrew-php brew tap homebrew/dupes brew tap homebrew/versions brew install php55-intl brew install homebrew/php/composer 
like image 129
4 revs, 2 users 98% Avatar answered Sep 25 '22 06:09

4 revs, 2 users 98%


Try this instead and change the setting on the fly, just for this command

curl -sS https://getcomposer.org/installer | php -d detect_unicode=Off 
like image 30
Andreyco Avatar answered Sep 26 '22 06:09

Andreyco