title: having trouble installing composer
body: <p>I am installing composer with the following cammand</p>
  
  <pre><code>curl -s https://getcomposer.org/installer | php
  </code></pre>
  
  <p>But I am keep getting below <strong>error message</strong></p>
  
  <pre><code>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.
  </code></pre>
  
  <p>How can I install composer be removing above error?</p>
  
  <p><strong>EDIT</strong></p>
  
  <pre><code>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)
  </code></pre>
  
  <p><strong>Latest Edit</strong></p>
  
  <p>After some research I found that <code>php.ini</code> file which is being used is in <code>/etc/php.ini</code>. However, when I checked this file in <code>/etc</code> folder it wasn't there. <code>/etc</code> folder contained <code>php.ini.default</code> folder which linked to <code>/private/etc/php.ini.default</code>. So I added <code>detect_unicode = Off</code> in <code>/etc/php.ini.default</code> and the renamed this file to <code>php.ini</code>. Now when I execute below command</p>
  
  <pre><code>curl -s https://getcomposer.org/installer | php
  </code></pre>
  
  <p>OR</p>
  
  <pre><code>sudo curl -s https://getcomposer.org/installer | php
  </code></pre>
  
  <p>Then I get following errors</p>
  
  <pre><code>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.
  </code></pre>
  
  <p>How can I install composer on my computer and remove above problems? Please help</p>