7

I'm trying to install composer and I'm getting an error ,

What I did ,

  1. Downloaded composer wget https://getcomposer.org/installer
  2. php installer --check

All settings correct for using Composer

  1. php installer

The error I got ,

The "https://getcomposer.org/versions" file could not be downloaded: Failed to enable crypto failed to open stream: operation failed The download failed repeatedly, aborting.

I tried google but no luck

lasan
  • 365
  • 2
  • 5
  • 13
  • Composer requires PHP's openssl extension, you're probably missing it. (Or it's too old to work with the remote Composer server.) – Alex Howansky Dec 01 '17 at 15:06
  • @AlexHowansky How to add openssl extension ? – lasan Dec 01 '17 at 15:07
  • Run `php -m` from the command line, that will list the enabled extensions. Then run `php -v` to see what version of PHP you have. Post the results into your question. – Alex Howansky Dec 01 '17 at 15:09
  • FWIW, there's usually little need to install composer on the production server. You can use it to install all dependencies locally, package that up and upload it to the server… – deceze Dec 01 '17 at 15:16

3 Answers3

9

I know this question is quite old, but I've been looking for an answer to it for a while and just got it answered, so here it is.

Can you install composer on a Godaddy shared hosting: no you can't.

BUT

Godaddy Shared hosting used to use a legacy control panel. If your shared hosting account is old, you are most likely using it. But, Godaddy has moved to cPanel for Linux hosting and all new Linux shared hosting purchases now come with it. The good news is, there is a version of Composer installed on these accounts (currently it's 1.1.1).

Follow this link to see software versions on Godaddy's hosting accounts.

I was on the phone with Godaddy's tech support, and they confirmed that Composer was installed out-of-the-box for cPanel hosting accounts.

Hope that helps.

Julien B.
  • 3,023
  • 2
  • 18
  • 33
  • 1
    Alternatively, you might be able to use the portable version of Composer but I did not try it. To get the portable version of Composer `curl https://getcomposer.org/installer | php` and then use it with `php composer.phar some-command` or with `./comoser.phar some-command` if the file is marked as executable. – Julien B. Aug 16 '20 at 15:29
1

You can install Composer 2 on godaddy

From your home directory /home/[USER] do

wget https://getcomposer.org/installer
php installer

Once it is installed you can then setup an alias in your .bashrc file so every time you run composer it uses the new 2.0+ version

nano .bashrc
alias composer='php /home/[USER]/composer.phar'
wrg20
  • 21
  • 1
0

GoDaddy Provides Composer as Preinstalled with your hosting. You can access the command line tools like Composer by SSH. Request SSH Access for your Account. as the Account gets activated, you can access SSH by your FTP userId and Password. to check the composer is installed, just run composer -v.

Kiran Maniya
  • 8,453
  • 9
  • 58
  • 81