PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, January 1, 2022

[FIXED] PHP Composer Installation on OS Catalina

 January 01, 2022     composer-php, macos-catalina     No comments   

Issue

Just tried to install composer on my new Macbook Pro. Ran into an issue when I tried to install it globally. I'm not sure if this operating system related or not.

My Steps

  1. sudo php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
  2. sudo php -r "if (hash_file('sha384', 'composer-setup.php') === 'a5c698ffe4b8e849a443b120cd5ba38043260d5c4023dbf93e1558871f1f07f58274fc6f4c93bcfd858c6bd0775cd8d1') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
  3. sudo php composer-setup.php
  4. sudo php -r "unlink('composer-setup.php');"
  5. sudo mv composer.phar /usr/local/bin/composer

Problem

I can run composer if I access it directly. php composer.phar works just fine. But I can't get it to work globally by moving it to the /usr/local/bin/composer directory.

Question

Is this operating system related? And if you could shed anymore light onto the issue that would be great.


Solution

The answer is no, it is not operating system related.

In this case, I made the mistake of moving composer.phar into a folder named composer. So the structure was this: /usr/local/bin/composer/composer.phar. The correct approach is to rename composer.phar to composer, making the structure /usr/local/bin/composer.



Answered By - Jacob
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing