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 | /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”:


    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 :

81 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.

  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.

    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

      1. Marco says:

        Any news about this topic?
        Thanks and Regards,

        1. 1and1help says:

          Hi Marco,

          since October 2017 we are offering PHP 7.1-cli. It’s still not the standard version on the shell, so you have to trigger it with its path


          Best regards,
          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?


    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:

      Best regards,
      Michael, 1&1

      1. Nicolas.jablonski says:

        hello michael,

        does it means that the 1and1 shared hosting are not able to host a laravel installation ? Too much restrictions rights.

        i’m trying to install it without success and i wonder if that’s possible.

        thank you

        1. 1and1help says:

          Unfortunately, I can’t see informations on the Laravel website, which composer or php-cli version you need to install the framework by your own. If it’s running with PHP 5.5 on the command line, it might work.

          Newer php-cli versions are planned for the future, but currently we can’t give you an ETA.

          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:

      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:

      Michael, 1&1

  9. Steve says:

    I have php7 installed now, but composer gives me the error: requires php >=5.6.0 -> your PHP version (5.4.45) does not satisfy that requirement. How can I force composer to use php7?

    1. 1and1help says:

      Hi Steve,

      at the moment the PHP versions you can use with us differ between browser commandos via http/s and the version you can use via command line.

      For command line scripts (and cronjobs as well) we only offer PHP up to PHP 5.5 (php5.5-cli).

      Regarding plans for updates, please read here:

      Michael, 1&1

  10. Russ says:

    This lack of php 5.6 or php 7 support on the command line is appalling. When are you going to fix it?

  11. 1and1help says:

    Hi Russ,

    It’s definitely on our agenda, but no final ETA yet, sorry.

    Best regards,
    Michael, 1&1

  12. Marouane says:

    Just run one commande to install PHP5.6,
    We are waiting to fix this problem

    1. 1and1help says:


      that might be true if you are running PHP on your own single root server. Our shared hosting infrastructure is much more complex than that, so running one simple command is unfortunately not enough. Updating the PHP versions has to be planned very carefully by our admins. That’s whats happening at the moment. They are working hard to deliver newer versions as soon as possible.

      Best regards,
      Michael, 1&1

  13. Cristian says:

    Hi, I have installed on my hosting site the php composer, but once the page is launched from the browser it says the following error despite the path is correct “Fatal error: require_once(): Failed opening required ‘../vendor/autoload.php’ (include_path=’.:/usr/lib/php5.6′)”, why – how can i fix it? Thanks in advance

    1. 1and1help says:

      Hi Cristian,

      this is the reason for the error message – and still the current status:

      Best regards,
      Michael, 1&1

      1. Cristian says:

        Ok but i how to fix it, i can not wait, i have moved the domain to have better services but i always find myself at the same point!

      2. Cristian says:

        Ok Then since I bought your hosting for more services I have to tell you I have to wait? I can not wait for you to create a disservice

        1. 1and1help says:

          Hi Cristian,

          at the moment there is no way to fix this in our shared hosting packages. As soon as we are rolling out updates to our servers, you should be able to use the latest composer versions.

          For now, maybe another hosting product would be a better solution for you. Don’t hesitate to contact us for a consultation:

          Best regards,
          Michael, 1&1

  14. Edmon says:


    After running successfully the commands you show in this tutorial, when I type the composer command, the message

    -bash: composer: command not found


    Anything else I should do to have it?


    1. Edmon says:

      Oh, got it , I should always use

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


  15. Femi says:

    I have Php 7.0 install on my 1&1 Basic contract and I used mysql_connect() in my project. I have check the php setting on my CP but no version 5.6 or 5.5 there. What can I do to make changes to this version.


    1. 1and1help says:

      Hi Femi,

      we still offer PHP 5.6 in the PHP settings of your contract free of charge.

      If you want to use PHP 5.5, we can activate the PHP 5.5 Extended Support with an additional monthly fee for you. If you are interested in this, just e-mail us for further informations:

      Best regards,
      Michael, 1&1

  16. Mark says:

    I am trying to install composer with PHP 5.6> but Icant, are there any solution about this ? cos in admin panel is seems I have php 7. I dont undesrtand why I can use in ssh other php version this does not have logic

    1. 1and1help says:

      Hi Mark,

      I am sorry, but at the moment there is no workaround for this in our webhosting packages. Our dev team is still working on updates for php-cli. There is no ETA for it yet. We’ll keep all users updated on that subject in the future.

      Best regards,
      Michael, 1&1

  17. Robert Riso says:

    The initial download command: curl -sS | /usr/bin/php5.5-cli

    returns these errors:
    bash: /usr/bin/php5.5-cli: No such file or directory
    curl: (77) Problem with the SSL CA cert (path? access rights?)

  18. Robert Riso says:

    I got past the problem I reported – however, I have another:

    I’m running PHP7.0.21 for this website, but when I check the version in putty I get 5.3.3, and cannot install the Google API client library, which requires 5.4. How/where do I upgrade to 5.4 or better for the command line?

    1. 1and1help says:

      On command line you have to extend your php command to the following path:


      PHP 5.5 is currently the latest PHP version we offer on the command line.

      Best regards,
      Michael, 1&1

      1. Robert Riso says:

        /usr/bin/php5.5-cli is an empty directory. There is no php interpreter or symbolic link there.

        1. 1and1help says:

          Sorry for the irritation. We are not talking about shared hosting but your own root server? In this case you might have to define the default PHP version on your webserver. If you are using Plesk to configure your server applications, this link might help:

          Best regards,
          Michael, 1&1

  19. Bernard says:

    i have a problem when a using php in command line with ssh,
    please i want to set php in php6 by default!how can i do?

    1. 1and1help says:

      Hi Bernard,

      PHP 6 was planned but never released. In the end, they rolled out PHP 5.4 instead. You would have to use the path like this:


      The next step would be PHP 7, which we dont support for CLI yet (latest version on our shared servers: /usr/bin/php5.5-cli). We plan to update the versions in the future, but no ETA for this yet.

      Best regards,
      Michael, 1&1

  20. Hi,
    It’s been so long that I can’t update my website with *composer* due to PHP version problem. I select php7 but in console I can not find php7.
    What happen ?

    1. 1and1help says:


      you can find the reason for this here:

      This is the current status, our IT is working on updates for the future.

      Best regards,
      Michael, 1&1

  21. Alexis Petithomme says:

    I try to launch a crontab with php but the best I obtain is “Installed PHP Version is too old! Required minimum version is PHP 5.6 (Installed: 5.4.45)”.
    This cron job is used to send notifications, I cannot work without these.
    Have you any solution ?
    The best I have for now is to move to another hosting service…

    1. 1and1help says:

      Hi Alexis,

      in the current situation, php for command line is only installed up to php5.5-cli.

      Maybe a workaround could be to open the file in your cron via curl or wget.

      Best regards,
      Michael, 1&1

      1. Alexis Petithomme says:

        Thank you for your answer but I don’t know how to open a yii file with wget. The command line I have to install is “30 * * * * /path/to/humhub/protected/yii cron/hourly”
        I don’t know how to send a parameter to yii with wget…
        Can you help me ?

        1. 1and1help says:

          Sorry, we have no experience with Yii. Maybe you might ask the Yii developers if there is a workaround to run this with curl or wget.

          Michael, 1&1

  22. Howie says:

    I too would like to access the command line version of PHP 5.6 (php5.6-cli) via SSH on my shared 1&1 host.
    What is strange to me is that php5.6-cli seems to exist in a web server context but not in an SSH context.
    I configured my website through the 1&1 Control Panel to use PHP version 5.6.
    On my website, I have a webpage consisting of this PHP code:
    echo '’ . `hostname -f; ls -l /usr/bin | grep php` . ”;
    The result shows php5.6-cli:
    lrwxrwxrwx 4 root root 21 Jul 31 09:03 php -> ../lib/cgi-bin/php5.6
    -rwxr-xr-x 4 root root 4190 Jul 31 09:03 php-config5.6
    lrwxrwxrwx 4 root root 21 Jul 31 09:03 php5.6 -> ../lib/cgi-bin/php5.6
    -rwxr-xr-x 4 root root 13455728 Jul 31 09:03 php5.6-cli
    -rwxr-xr-x 4 root root 4495 Jul 31 09:03 phpize5.6

    When I log into my server using SSH and run the same command (hostname -f; ls -l /usr/bin | grep php), it shows the same hostname but it only shows older versions of PHP:

    lrwxrwxrwx 4 root root 6 Feb 28 2017 php4 -> php4.4
    lrwxrwxrwx 4 root root 21 Feb 28 2017 php4.4 -> ../lib/cgi-bin/php4.4
    -rwxr-xr-x 8 root root 4502656 Feb 28 2017 php4.4-cli
    lrwxrwxrwx 4 root root 6 Mar 1 2017 php5 -> php5.2
    lrwxrwxrwx 4 root root 21 Mar 1 2017 php5.2 -> ../lib/cgi-bin/php5.2
    -rwxr-xr-x 8 root root 8307384 Mar 1 2017 php5.2-cli
    lrwxrwxrwx 4 root root 21 Mar 1 2017 php5.4 -> ../lib/cgi-bin/php5.4
    -rwxr-xr-x 12 root root 12662384 Mar 1 2017 php5.4-cli
    lrwxrwxrwx 4 root root 21 Mar 1 2017 php5.5 -> ../lib/cgi-bin/php5.5
    -rwxr-xr-x 12 root root 13201840 Mar 1 2017 php5.5-cli
    lrwxrwxrwx 4 root root 21 Mar 1 2017 php6 -> ../lib/cgi-bin/php5.4

    Does anyone know how 1&1 is able to show one set of (old) PHP binaries in SSH context and a different set of (new) PHP binaries in web server context? I think understanding that may give us a way to access php5.6-cli (along with the CLI versions of PHP 7+).


    1. 1and1help says:

      Hi Howie,

      we are talking about 2 different environments for PHP. The old versions for CLI are from an older enviroment which is not connected to the new one which allows you to define PHP for the web browser per domain. Our developers are working on functionalities to combine these two worlds – and ensure up to date php-cli versions also for the future.

      In the mean time, this workaround might work for you:

      Best regards,
      Michael, 1&1

      1. Johan says:

        I am happy to see my work is being appreciated by 1&1 as well 🙂

        I will provide updates to the PHP 7 binaries until 1&1 has their PHP 7 CLI setup working. At least now there is a workaround for those in need.

        1. 1and1help says:

          Thanks Johan! In fact, we appreciate it very much. 🙂

      2. Howie says:

        Hello Michael,
        I see that the command line version of PHP 7.0 has been added in the past week for 1&1 shared hosting. Thank you!



        > ls -ltr /usr/bin | grep php

        lrwxrwxrwx 2 root root 21 Sep 4 04:32 php7.0 -> ../lib/cgi-bin/php7.0
        -rwxr-xr-x 5 root root 13774384 Sep 4 04:32 php7.0-cli

        1. 1and1help says:

          Hi Howie,

          true – our developers surprised us with that last Friday 🙂

          More versions will follow in the future.

          Best regards,
          Michael, 1&1

  23. Stefan Schreck says:

    Great news.

  24. Amer says:

    Hi Michael

    We have a 1&1 Performance M, Managed Server in place.

    We recently hired a freelance developer to update one of our websites significantly. He has written all the code on his own (non 1&1) test server and has now said that he needs Git and Composer on our server for his software to work.

    We understand we could switch to a non-manager server and he can install these, but since we do not have a retained IT staff we are very reluctant to go to a non-managed solution as we will not be able to update and protect on a regular basis.

    Can you please suggest what alternative solutions we have?



    1. 1and1help says:

      Hi Amer,

      you (or your developer) should be able to install Composer on the Managed Server.. We upgrated to /usr/bin/php7.1 in the last weeks, so the latest stable composer version should run now on your system.

      Git is availabe on your server as well. So as far as you don’t need to run commands or configure values which only the root user can run, the software should work on your Managed Server.

      Best regards,
      Michael, 1&1

  25. Tom says:

    Hi, I noticed that someone commented that command line php7 is now available, could you let me know how I can use this please. in Control Panel I have the PHP version set to 7, however in the command line my version is showing as 4.4.9 – I can use php5.5, however I need a higher version for what I need to do.
    All help greatly appreciated.

    1. 1and1help says:

      Hi Tom,

      as the latest CLI version we are offering PHP 7.1 right now. For now, this has nothing to do with the version you chose in the Control Panel.

      If you try to run php commands via CLI, the default version for “php” is 4.4.9.

      To address PHP 7.1 for CLI, you have to configure your script, application or cronjob with the concrete path, e.g.:


      Best regards,
      Michael, 1&1

      1. Tom says:

        Thank you Michael. 🙂

  26. Roberto Landa says:

    Buenas noche estoy haciendo un sistema de notificaciones en tiempo real el sistema funciona correctamente en local pero una ves que lo subi no me muestra mi los mensajes.

    [WebPush] gmp extension is not loaded but is required for sending push notifications with payload or for VAPID authentication. You can fix this in your php.ini.

    1. 1and1help says:


      please send us more data and further informations via e-mail at if you avidence that this depends on limitations of our web server. We will have a deeper look into it for you then.

      Best regards,
      Michael, 1&1

  27. Tem says:

    I get this:
    All settings correct for using Composer
    The installation directory “/” is not writable

    1. Tem says:

      Sorry, I had to change directory to home (cd ~)

      1. 1and1help says:

        Hey Tem,

        great that you found the solution by yourself and its working now.

        Best regards,
        Michael, 1&1

  28. Andy Waring says:

    I’ve added composer and got this response –

    Composer (version 1.5.6) successfully installed to: /homepages/nn/nnnnnnnnn/htdocs/composer.phar
    Use it: php composer.phar

    But then I get this error…

    (uiserver):unnnnnn:~$ php composer.phar require mailgun/mailgun-php php-http/guzzle6-adapter php-http/message
    X-Powered-By: PHP/4.4.9
    Content-type: text/html

    Parse error: syntax error, unexpected T_STRING in /homepages/nn/nnnnnnnnn/htdocs/composer.phar on line 100

    Please can you help

    1. 1and1help says:

      Hi Andy,

      with “php” only, you run PHP 4.4.9 on SSH.

      To run composer with a current PHP version, please use the concrete path instead:


      Best regards and happy holidays,
      Michael, 1&1

      1. BarthFoxIdman says:

        Hello ,I’ve got the same error. I am using laravel framework and my php version is 7.1. How to install correctly composer and and to my index because i can’t access to it

        1. 1and1help says:


          please don’t mix up the PHP version you set up for your domain in the control panel (for scripts running in the browser only) with the version you use on the webspace via command line. They are different.

          Use “/usr/bin/php7.1-cli” instead of “php” to install composer on the shell.

          Michael, 1&1

          1. BarthFoxIdman says:

            I use this commande line in my shell:

            curl -sS | /usr/bin/php7.1-cli
            but composer is not yet recognized .
            Other i can’t access my public website.

        2. 1and1help says:

          About your latest comment:

          With this command you only download composer and make the composer.phar available. Now start composer with the command of step 2 in the article above.

          After doing this, you have to configure your application with composer – please read the manual of your app how you can do this.

          Thanks and best regards,
          Michael, 1&1

  29. Houssem says:


    I have changed the php version to 7.1 , but when I test it with php -v , it’s still 4.4.9.
    I have created .profile fike in the root and I have added this line :
    alias php=’/usr/bin/php7.1-cli’

    But the version is still 4.4.9. Help please

    1. Houssem says:

      It’s ok now, the version was updated.

  30. Houssem says:

    I have tried to donwload an external library with composer.phar but I got this error:

    mmap() failed: [12] Cannot allocate memory

    mmap() failed: [12] Cannot allocate memory

    Fatal error: Out of memory (allocated 620765184) (tried to allocate 4096 bytes) in phar:///homepages/21/d676354179/htdocs/composer.phar/src/Composer/DependencyResolver/RuleSetGenerator.php on line 126

    1. 1and1help says:

      Hi Houssem,

      looks like you tried to allocate more memory than available on your contract.

      Please keep in mind: You are still using shared hosting. Means that you share also the ressources of the server with other users. Looking at your error message you were able to use 620M – which is not so bad for shared hosting – feel free to compare with other hosting companys.

      If you need more ressources you might consider switching to a Managed server where you no longer share the ressources with others.

      Best regards,
      Michael, 1&1

  31. carmen says:

    I have the same problem as Houssem, but in my contract 1&1 Unlimited, it sais “Web space : unlimitted”.
    So, what is the problem, please ?
    Best regards

    1. 1and1help says:

      Hi carmen,

      webspace has nothing to do with the memory_limit for scripts in your hosting pages.

      Webspace is like the installed hard drive disc in your computer, memory is like the RAM of your pc.

      Here you can find more informations about script limits of our tariffs:

      Please note that error messages mostly show you the memory in Bytes – so you have to turn Bytes into Megabytes when you want to know how much RAM your script is allocating.

      Best regards,
      Michael, 1&1

  32. Carmen Fabo says:

    Hi Michael,
    thank you very much for your clear explanations and informations.
    I have another question, please:
    In the informations that you have provided in the link, there is a “Memory limit” data; in my case (2014, 1&1 unlimited) it is 80 MB.
    In my connexion ssh I write “ulimit -a” to verify this and I can see
    – max locked memory (kbytes, -l) 64
    – virtual memory (kbytes, -v) 786432
    Please, which one of these data match to this “Memory limit” ?
    Thank you in advance,
    best regards,

  33. Carmen Fabo says:

    Hi Michael,
    please, don’t consider my last message, I suppose that Memory-limit
    match “virtual memory” because of the 80 MB matches.
    I am sorry for my last message, I don’t want you to lose your time.
    Best regards,

    1. 1and1help says:

      Hi Carmen,

      no worries – that’s what I am here for 🙂

      If you want to see the PHP Memory Limit for your webhosting account, you could create a file called phpinfo.php. In this file write the following php code:

      Then open the file in your browser by typing “” into your address bar. Then you find all relevant PHP informations of your package.

      Best regards,
      Michael, 1&1

Leave a Reply

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