PHP Composer on a Hostgator Shared Account

Posted on the October 14th, 2013 under Internet,Linux by Tohir

If you were to try and install composer on a Hostgator Shared Account, you’ll likely get an error like below:

Warning: Unexpected character in input: ‘\’ (ASCII=92) state=1 in – on line 399
#!/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 phar extension is missing.
Install it or recompile php without –disable-phar

Your PHP (5.2.17) is too old, you must upgrade to PHP 5.3.2 or higher.

The problem is that PHP 5.3 is not the default, but it is available. To install, run instead:

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

Which results in:

#!/usr/bin/env php
All settings correct for using Composer
Downloading…

Composer successfully installed to: /home/tohir/www/example.com/composer.phar
Use it: php composer.phar

Lastly, when you are running composer install, the command needs to be:

/opt/php53/bin/php composer.phar install

Sample Output:

Installing dependencies (including require-dev) from lock file
– Installing respect/validation (dev-develop 3956203)
Cloning 39562034bd5cb692289f603bac8766f4d167426e

– Installing slim/slim (2.3.1)
Downloading: 100%

Generating autoload files

 

 



5 Responses to 'PHP Composer on a Hostgator Shared Account'

  1. March 1, 2014 at 7:55 am
    xan
  2. May 10, 2014 at 1:51 am
    Glauco Márdano
  3. January 12, 2015 at 4:14 pm
    Matheus
  4. February 16, 2015 at 9:35 pm
    Pablo Levy
  5. December 1, 2015 at 6:41 pm
    Rfael

Leave a Reply




XHTML::
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>