vinsa
vinsa

Reputation: 1242

Installing composer on GoDaddy hosting cause parse error

I'm trying to install composer on my shared Godaddy's hosting. I need composer to install laravel. I'm using PUTTY to connect via SSH. I do connection successfully, when type

-bash-3.2$ ls

I get these folders:

 data  html  scctmp  tmp

Then I type this:

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

it return me:

Content-type: text/html

<br />
<b>Parse error</b>:  syntax error, unexpected T_NEW in <b>-</b> on line <b>382</b><br />

How to resolve this problem?

Upvotes: 3

Views: 6734

Answers (3)

George Demko
George Demko

Reputation: 41

on shared hosting such as 1and1 or GoDaddy try:

php -r "readfile('https://getcomposer.org/installer');" | php5.5

or

php -r "readfile('https://getcomposer.org/installer');" | php5

Upvotes: 4

Martin Pein
Martin Pein

Reputation: 81

Not sure if still needed, but worked for me when using

-bash-3.2$  curl -sS https://getcomposer.org/installer | /usr/local/php5_3/bin/php

and

-bash-3.2$ /usr/local/php5_3/bin/php composer.phar install

which is invoking PHP 5.3.14.

Upvotes: 7

Magd Kudama
Magd Kudama

Reputation: 3459

This is probably the php version being outdated (at least php-cli). I guess that's common when you're in a shared hosting.

Type php -v and make sure the version is greater than 5.3.2, which is the older version you can get to install Composer for package management.

Upvotes: 5

Related Questions