Blog coding and discussion of coding about JavaScript, PHP, CGI, general web building etc.

Tuesday, May 31, 2016

How do I install Composer on a shared hosting?

How do I install Composer on a shared hosting?


I have these things:

How can I install Composer? (My aim is to install Restler)

Edit: I do not have SSH access.

Answer by Kevin Newman for How do I install Composer on a shared hosting?


It depends on the host, but you probably simply can't (you can't on my shared host on Rackspace Cloud Sites - I asked them).

What you can do is set up an environment on your dev machine that roughly matches your shared host, and do all of your management through the command line locally. Then when everything is set (you've pulled in all the dependencies, updated, managed with git, etc.) you can "push" that to your shared host over (s)FTP.

Answer by niutech for How do I install Composer on a shared hosting?


I have successfully installed Composer (and Laravel) on my shared hosting with only FTP access:

  1. Download and install PHPShell on a shared hosting

  2. In PHPShell's config.php add a user and an alias:

    php = "php -d suhosin.executor.include.whitelist=phar"

  3. Log in to PHPShell and type: curl -sS https://getcomposer.org/installer | php

  4. When successfully installed, run Composer: php composer.phar

Answer by Johnathan Elmore for How do I install Composer on a shared hosting?


This tutorial worked for me, resolving my issues with /usr/local/bin permission issues and php-cli (which composer requires, and may aliased differently on shared hosting).

First run these commands to download and install composer:

cd ~  mkdir bin  mkdir bin/composer  curl -sS https://getcomposer.org/installer | php  mv composer.phar bin/composer  

Determine the location of your php-cli (needed later on):

which php-cli  

(If the above

fails, use which php)

It should return the path, such as /usr/bin/php-cli, /usr/php/54/usr/bin/php-cli, etc.

edit ~/.bashrc and make sure this line is at the top, adding it if it is not:

[ -z "$PS1" ] && return  

and then add this alias to the bottom (using the php-cli path that you determined earlier):

alias composer="/usr/bin/php-cli ~/bin/composer/composer.phar"  

Finish with these commands:

source ~/.bashrc  composer --version  

Answer by Piero for How do I install Composer on a shared hosting?


I was able to install composer on HostGator's shared hosting. Logged in to SSH with Putty, right after login you should be in your home directory, which is usually /home/username, where username is your username obviously. Then ran the curl command posted by @niutech above. This downloaded the composer to my home directory and it's now accessible and working well.

Answer by PWM for How do I install Composer on a shared hosting?


You can find detailed information including all steps on how to do this at this site: Pure Web Media - Installing Drush on Shared Hosting

Have successfully accomplished this on various shared hosting services.

Answer by ntraykov for How do I install Composer on a shared hosting?


You can do it that way:

  • Create a directory where you want to install composer (let's say /home/your_username/composer)
  • Go to this directory - cd /home/your_username/composer
  • Then run the following command:

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

  • After that if you want to run composer, you can do it this way (in this caseyou must be in the composer's dir): php composer.phar

  • As a next step, you can do this:

    alias composer="/home/your_username/composer/composer.phar".

    And run commands like you do it normally: $ composer install

Hope that helps

Answer by Dung for How do I install Composer on a shared hosting?


SIMPLE SOLUTION (tested on Red Hat):

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

to use it: php composer.phar

SYSTEM WIDE SOLLUTION (tested on Red Hat):

run command: mv composer.phar /usr/local/bin/composer

to use it: composer.phar update

now you can call composer.phar from any directory.

Source: http://www.agix.com.au/install-composer-on-centosredhat/


Fatal error: Call to a member function getElementsByTagName() on a non-object in D:\XAMPP INSTALLASTION\xampp\htdocs\endunpratama9i\www-stackoverflow-info-proses.php on line 72

Related Posts:

0 comments:

Post a Comment

Popular Posts

Fun Page

Powered by Blogger.