Using PHP Composer in the 1&1 Web Hosting Packages

PHP Composer (Composer) is a so-called „dependency management tool“, which makes possible for you to comfortably reference and keep up-to-date the external sources and libraries in your own PHP projects.

Many open source projects now no longer supply any ZIP archives or other installation packages – but reference the respective GitHub repositories.

To use Composer in the 1&1 Web Hosting and Performance Hosting packages, you must know that Composer is not installed by default, that it is a small PHP script, which requires a PHP interpreter. However, 1&1 offers a variety of current PHP versions – which can be set for each domain.

By default, Composer will however not be called in the web browser, but via the so-called shell or console.

Note: In almost all 1&1 packages, shell access via SSH is possible. If your package does not support SSH access, you should best change to the next higher one, because Composer itself requires more resources.

To use Composer in your 1&1 Web Hosting package, please log in via SSH and execute the following steps – should you have any questions, insert them as comments at the end of the article:

    1. Download Composer:

      curl -sS https://getcomposer.org/installer | /usr/bin/php5.5-cli


      Then, a composer.phar file is available in your webspace. If you call the composer.phar directly, you will get an error because Composer will not automatically find the correct PHP version.

    2. Start Composer for the first time:

      /usr/bin/php5.5-cli composer.phar


      As a result, you get an overview of all the Composer “commands”:

      Composer

    3. To always use the latest Composer version, use for example the following command:

      /usr/bin/php5.5-cli composer.phar selfupdate

 

Important note:

The path to PHP-CLI in the above example depends on the version and may change!

 

We look forward to your feedback! Have you already been using Composer?

 

Please rate this post :

15 thoughts on “Using PHP Composer in the 1&1 Web Hosting Packages

  1. Kate Davis says:

    Next week, we will tell you how to use Composer at 1&1, e.g. when installing the CMS Typo3 NEOS.

    Please do the above as I keep hitting errors on the install!

    1. Philipp Bellmann says:

      Hey Kate,

      we will start work on the NEOS guide later than expected. We know that getting NEOS up and running is not trivial, so we want to provide a thourough guide, once we release it. Thanks for your patience.
      Phil

  2. Kate Davis says:

    I am trying to install Neos on a 1and1 site and could do with getting past the failing install screen.
    I use SSH to do the Composer aspect. I change flow.bat, Setting.yaml and although phpinfo can find php version and php.ini, the Neos install aspect cannot work out anything.

    I have quite happily installed it under Mamp on my Mac. My brain is totally confused and completely embarrassed, please help?

  3. Lui says:

    What to do when we have a composer out of memory error while running composer update?

    1. Ness says:

      I have the same problem

  4. mark says:

    Ive got composer installed and want to add the Amazon API to it but keep getting this error even though Im referencing PHP6? How do I force it to use PHP6?

    exeu/apai-io 2.0.0 requires php >=5.6.0 -> your PHP version (5.4.45) does not satisfy that requirement.

    1. 1and1help says:

      Hi mark,

      in our history of PHP versions over the last years, PHP6 is in fact PHP 5.4 (the PHP community had plans for PHP 6, but dropped them and released 5.5, 5.6 and as a next step 7.0 instead).

      For usage via shell commands we are not offering more than php5.5 yet. Will be updated in the future, but no ETA for it yet, sorry.

      Michael, 1&1

  5. Diego says:

    I don’t understand why we must use php 5.6 or php 7 in our hosting but can’t use in ssh console.
    You must offer php 5.6 or php 7 soon as posible because a lot of modules in compose need php 5.6 or more.
    Diego.

    1. 1and1help says:

      Hi Diego,

      we are aware of that. Our developers are working on updates with high priority at the moment. As soon as we have concrete informations to share, we will let you know.

      Thanks for your patience,
      Michael, 1&1

  6. Rob says:

    Will 1&1 support installing Laravel and other more up to date frame works (mean stack stuff, etc)? If it does can you point to how to work within 1&1 to install/access it. IF not, why? and when, if at all, do you plan on getting this stuff updated to support these types of technologies?

    thanks!

    1. 1and1help says:

      Hi Rob,

      I am sorry, we have no plans to pre-install Laravel or other up-to-date frameworks on our shared hosting in the near future.

      If you are web developer, you might want to try out the 1&1 Cloud Severs (root version) as an alternative to a classic hosting package: https://www.1and1.com/dynamic-cloud-server

      Best regards,
      Michael, 1&1

  7. Orlando says:

    Hi,the console show me PHP 4.4.9 (cgi-fcgi) (built: Feb 28 2017 11:31:58), how can I change it to PHP 5.6 CLI, because php-cgi does not support -S , thanks!

    1. 1and1help says:

      Hi Orlando,

      this is still the current status: https://community.1and1.com/using-php-composer-at-1and1/#comment-178189

      The latest version you can get with us at the moment is php5.5-cli.

      Best regards,
      Michael, 1&1

  8. Andreas Anding says:

    When can we use PHP 7 on Command Line?

    1. 1and1help says:

      Hi Andreas,

      this is still the current status:

      https://community.1and1.com/using-php-composer-at-1and1/#comment-181374

      Best,
      Michael, 1&1

Leave a Reply

Your email address will not be published. Required fields are marked *