For the installation to work properly, all files written by Composer *must* be owned by the web server user. There are at least two ways to do this:

We suggest running Composer in a web server shell in a development environment only. In a more secure environment, you should change ownership to the web server user after you run Composer.

In the discussion that follows, it's assumed that the CentOS web server user is apache and the Ubuntu web server user is www-data.

Ubuntu

To switch to the web server user on Ubuntu:

  1. Enter the following command:
    su www-data
  2. If a password prompt displays but you don't know the user's password, continue with the next step; otherwise, continue with Running Composer to update dependencies.
  3. To enable the www-data user's shell and to set a password, enter the following command:
    sudo chsh -s /bin/bash www-data && sudo passwd www-data
  4. Enter the following command again and enter the user's password:
  5. su www-data
  6. Continue with Running Composer to update dependencies.

CentOS

To switch to the web server user on CentOS:

  1. Enter the following command:
    su - apache
    If you don't know the user's password or if the following error displays, continue with the next step; otherwise, continue with Running Composer to update dependencies.
    This account is currently not available.
  2. To give apache a valid shell account so you can switch to it, enter the following command:
    sudo chsh -s /bin/bash apache && sudo passwd apache
  3. Run the following command again; this time, it should work:
    su - apache
  4. Continue with the next section.