PHP Composer - Unable to install composer on macOS Sierra

brew install composer
catalina composer install
mamp install composer
php composer global install
composer setup exe for mac
install composer ubuntu
git composer install
programmatically install composer

I'm trying to install composer running the command provided on the getcomposer.org/download documentation site:

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('SHA384', 'composer-setup.php') === 'e115a8dc7871f15d853148a7fbac7da27d6c0030b848d9b3dc09e2a0388afed865e6a3d6b3c0fad45c48e2b5fc1196ae') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"

But I get an error message saying:

Warning: copy(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed in Command line code on line 1

Warning: copy(): Failed to enable crypto in Command line code on line 1

Warning: copy(https://getcomposer.org/installer): failed to open stream: operation failed in Command line code on line 1
Yoshihiros-MacBook-Pro:~ yoshihiro$ php -r "if (hash_file('SHA384', 'composer-setup.php') === 'e115a8dc7871f15d853148a7fbac7da27d6c0030b848d9b3dc09e2a0388afed865e6a3d6b3c0fad45c48e2b5fc1196ae') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"

Warning: hash_file(composer-setup.php): failed to open stream: No such file or directory in Command line code on line 1
Installer corrupt
Warning: unlink(composer-setup.php): No such file or directory in Command line code on line 1

Yoshihiros-MacBook-Pro:~ yoshihiro$ php composer-setup.php
Could not open input file: composer-setup.php

I'm also trying to install it globally but I can't get out of this message. Please help D:

Install Composer MacOS Sierra, I had same issues but this what I did: I copy paste this into the terminal php -r "​copy('http://getcomposer.org/installer', 'composer-setup.php');" on the terminal  In my mac I install composer via help of this link try this method if you just want to install composer. – Umair Iftikhar Jun 29 '18 at 8:57 I have installed composer successfully.

I had the same problem- here is the right way

  1. clean dir > Terminal > mkdir composer

  2. cd composer

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

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

    vim ~/.bash_profile

  5. alias composer="php /usr/local/bin/composer.phar"

Installing Composer on OS X · A Beautiful Site, I want to be able to run, for example, composer install and not php composer.​phar install . Any help is greatly appreciated! share. Share a link to this question. Composer gets PHP from the PATH. Use /usr/bin/env php -v to see what PHP version is resolved from the PATH. When running php -v in your shell, php may be a shell alias rather than the executable in your PATH (shell aliases are winning).

Introduction, I'm trying to install composer running the command provided on the getcomposer.​org/download documentation site: php -r  How to install Composer on Mac OS. Composer is a PHP tool to manage dependencies in your PHP project. Using simple commands you can add, update or remove the dependencies.

It works for me as follows:

I ran

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

on my terminal which made composer to be installed on my PC. And then I moved Composer to my bin folder so that I could run it globally:

mv Composer.phar usr/local/bin/composer

Composer, Composer is a cross-platform dependency manager for PHP libraries. This article will explain how to install it on OS X and add an alias so you can Some settings on your machine make Composer unable to work properly. First, Composer for Mac is a tool for dependency management in PHP. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you.

The instructions in Composer official page is sometimes confusing

or not working on macOS Sierra.

But installation is still simple like before.Just simply run two lines of command on your Terminal.

  1. curl -sS https://getcomposer.org/installer | php
  2. mv composer.phar usr/local/bin/composer

How to install Composer globally using MAMP's PHP · GitHub, Composer is a tool for dependency management in PHP. Installation - Linux / Unix / macOS# Now run php composer.phar in order to run Composer. Note: If the above fails due to permissions, you may need to run it again with sudo. Composer is a tool used to install php packages along with their dependencies in the project. It is useful for developers because we no longer have to manually integrate packages in the project.

MacOS Sierra: How to install Composer globally. · GitHub, Learn how to install and use composer, PHP dependency manager, on Mac OS. Easy installation using brew, zip, docker and so on. Hello! In this video, I am showing how you can setup and install composer on your mac and it is very easy no matter which Mac OS you have. For more tutorials subscribe to my channel and if you

PHP Composer, Install Composer to use MAMP's PHP.md Then you should be able to access Composer Global On Mac OSX High Sierra /usr/local/bin doesn't exist. If you have hardware or software that isn't compatible with macOS Sierra, you might be able to install the previous version, OS X El Capitan. macOS Sierra won't install on top of a later version of macOS, but you can erase your disk first or install on another disk.

Detailed description in a comment. // Just copy the code below. cd;. curl -s https://​getcomposer.org/installer | php;. sudo php installer;. sudo mv composer.phar  Download Composer Latest: v1.10.5. To quickly install Composer in the current directory, run the following script in your terminal. To automate the installation, use the guide on installing Composer programmatically.

Comments
  • great great great :D
  • "sudo mv composer.phar /usr/local/bin/ vim ~/.bash_profile" isn't work without using "mv [-f | -i | -n] [-v] source target" or "mv [-f | -i | -n] [-v] source directory".
  • Great! I was able to download the "composer.phar" file but I'm not able to place it in the global directory so I can access the command on terminal. I've checked on finder and there's no "bin" directory on "/usr". I tried to create the route "bin/composer" and then place the file there but I'm still not able to execute the composer command on terminal.
  • @YoshihiroOrtiz, the /usr directory is hidden and can't bee seen through finder. go the the directory where you download the composer, then use this command to move $ sudo mv ./composer.phar /usr/local/bin/