#1
  1. A Change of Season
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    3,536
    Rep Power
    221

    Problem with composer


    Installed it

    Code:
    php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
    php -r "if (hash_file('SHA384', 'composer-setup.php') === '****0ece3804abc52599c22b1f40f4323403c44d44fdfdd586475ca9813a858088ffbc1f233e9b180f061') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
    php composer-setup.php
    php -r "unlink('composer-setup.php');
    I get
    Code:
    php composer-setup.php
    All settings correct for using Composer
    Downloading...
    
    Composer (version 1.6.3) successfully installed to: /Users/****/composer.phar
    Use it: php composer.phar
    Question 1: Can execute like
    Code:
    php composer.phar
    but not like
    Code:
    composer
    Why not?

    Question 2: Also wanna use it globally so I did
    Code:
    mv composer.phar /usr/local/bin/composer
    And I get
    Code:
    mv: rename composer.phar to /usr/local/bin/composer: No such file or directory
    I see there is no bin in /usr/local/
    Code:
    cd /usr/local/MacBook-Pro:local myComp$ ls -la
    total 0
    drwxr-xr-x   3 root  wheel   96 Oct 25 15:30 .
    drwxr-xr-x@ 10 root  wheel  320 Feb 21 19:00 ..
    -rw-r--r--   1 root  wheel    0 Oct 25 15:30 .com.apple.installer.keep
    This location
    Code:
    mv composer.phar /usr/local/bin/composer
    is recommendeed by composer website. WHy recommend it if it doesnt exist?

    They say
    Note: On some versions of OSX the /usr directory does not exist by default.
    Then do
    Code:
    mkdir -p /usr/local/bin
    For me usr exists but bin doesnt exist.

    What am i doing wrong?
    Last edited by English Breakfast Tea; February 27th, 2018 at 08:43 AM.
  2. #2
  3. A Change of Season
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    3,536
    Rep Power
    221
    Ok

    Here is what I did, I got it working and it doesn't make sense:

    First I did
    Code:
    sudo mkdir -p /usr/local/bin
    Then
    Code:
    sudo mv composer.phar /usr/local/bin/composer
    How come I can just run it like
    Code:
    composer
    rather than
    Code:
    php composer.phar

IMN logo majestic logo threadwatch logo seochat tools logo