Shopware 6 - The HOME or COMPOSER_HOME environment variable must be set for composer to run correctly - composer-php

i just wanted to install the newest Shopware version 6.4.16.1 and i get this failure:
The HOME or COMPOSER_HOME environment variable must be set for composer to run correctly
i have composer installed and the home and composer_home variables are available on the server. what am i doing wrong? i have never got any error like that

This is indeed a known issue, which was fixed in the upcoming v6.4.17.0 release, see the official ticket.
A workaround for now would be to add a .env in the root directory with following content:
COMPOSER_HOME="/var/cache/composer"
If you already have a .env there just add that line.

Related

Wamp 3.1.3 Windows Environment PATH conflict [duplicate]

This question already has answers here:
How To Run PHP From Windows Command Line in WAMPServer
(12 answers)
Closed 4 years ago.
I just installed Wamp 3.1.3, and then installed composer.
The composer added the path to php.exe to windows environment variables. But now Wamp shows error in context menu , that when clicked shows this message:
There is an error.
There is Wampserver path (c:/wamp64)
into Windows PATH environnement variable: (C:\wamp64\bin\php\php7.2.4)
It seems that a PHP installation is declared in the environment variable PATH
C:\wamp64\bin\php\php7.2.4
Wampserver does not use, modify or require the PATH environment variable.
Using a PATH on Wampserver or PHP version
is detrimental to the proper functioning of Wampserver.
Now if I remove the path, wamp is happy, but composer would complain that php is not recognized program, and otherwise composer works but wamp complains to remove the path.
Any workaround?
Install the Composer manually:
Create bat script called composer.bat inside any directory within the PATH so it's system wide containing:
#C:\your\absolute\path\to\php.exe "%~dp0composer.phar" %*
Next time you change PHP simply update the path. Or you can have multiple scripts like composer-php6, composer-php7 etc. calling multiple php
versions. Just remember to put the composer.phar alongside your batch script.
No need to update the PATH at all. Good luck.

successful install of composer, but message shows: The HOME or COMPOSER_HOME environment variable must be set for composer to run correctly

I have installed composer on a Ubuntu vagrant box, running php 7.0 (which was just installed prior to this). Trying simply composer, or the full path php /usr/local/bin/composer both result in the following error:
The HOME or COMPOSER_HOME environment variable must be set for
composer to run correctly
I am unfamiliar with which env variable to set (or both), what value it should be set to, or where it should be set/declared! I've searched quite a few forums including github, but I'm not seeing this information. Appreciate your help.
UPDATE: Also tried this, same message:
curl -sS https://getcomposer.org/installer | php
The following worked for me, successfully allowing me to see the composer output:
export COMPOSER_HOME="$HOME/.config/composer";
composer
Note that I was able to just run composer in the project folder, didn't need to use the full path.
REFERENCE: https://github.com/consolidation/cgr/issues/10
(javi-dev commented on Feb 24)

composer installation using composer not working

I am trying to install laravel using composer
composer global require "laravel/installer"
but i get
I just finished reinstall my windows 7, before that laravel installation was always succesful and now it is not.. maybe someone know how solve this problem?
According to Laravel's Documentation
Make sure to place the $HOME/.composer/vendor/bin directory (or the equivalent directory for your OS) in your $PATH so the laravel executable can be located by your system.
In case of Windows you should ad that $PATH to your enviornment variables.

Confusing step in the Laravel Homestead installation process?

I'm going through the Laravel Homestead setup, but a particular instruction seems to be completely out of context/unexplained. I'm not at all familiar with composer, having only used npm for package management in the past.
In the 'Installing Homestead' section, under With Composer + PHP Tool it reads:
Once the box has been added to your Vagrant installation, you are ready to install the Homestead CLI tool using the Composer global command:
composer global require "laravel/homestead=~2.0"
Make sure to place the ~/.composer/vendor/bin directory in your PATH so the homestead executable is found when you run the homestead command in your terminal.
http://laravel.com/docs/4.2/homestead
Emphasis mine. What does this mean? What ~/.composer/vendor/bin directory? What PATH? Feels like it's missing a step!
Updating the PATH variable is slightly out of the spec of the Laravel docs as its something you should do for composer, but regardless I too think Laravel should at least link through to a resource of how to go about it.
Create/edit your ~/.bash_profile, add the following
export PATH=~/.composer/vendor/bin:$PATH
finally run source ~/.bash_profile to update your environment
I wrote a blog on this which goes into a little more detail http://blog.iwader.co.uk/updating-path-environment-variable-osx-and-unix-systems/

Composer could not find the config file

I want to create a laravel project by composer. I try to run this:
composer create-project laravel/laravel c:/laravel --prefer-dist
There is an error which is:
[InvalidArgumentException]
Composer could not find the config file: C:\ProgramData\ComposerSetup\bin
To initialize a project, please create a composer.json file as described in
the http://getcomposer.org/ "Getting Started" section
The composer.json file is:
{
"require": {
"laravel/laravel": "4.2.0"
}
}
I am using windows 8 and use cygwin.
I also have a proxy on my computer so I set the path of HTTP_PROXY_REQUEST_FULLURI and HTTPS_PROXY_REQUEST_FULLURI to 0 and false
Any idea?
Delete the environment variable composer. And It will work.
I found the solution like this:
COMPOSER=composer.json composer create-project laravel/laravel c:/laravel --prefer-dist
and it works!
See: Composer on Windows 7 (x64): issue #1720
The link above recommends that you delete the environment variable COMPOSER.
I have tried, and it worked.
I deleted the environment variable composer. Worked for me.
did you put your composer.json under c:/Laravel? if yes
in your cmd:
C:\> cd Laravel
C:\Laravel> composer create-project laravel/laravel project-name --prefer-dist
Just a note to everybody make sure to restart your doc command prompt windows after you remove the env by going to start type env press on Environmental, under system look for composer and remove the line. I spent an hour till i realized that i needed to restart the dam command window.
Note: As suggested above remove Environment variables, if you remove the environment variable you may not be able to run the composer command successfully, depending on how many times composer is defined in your variables.
as for me I had different composer environment variables from continuous tweaking, I had to delete them all, I decided to re-install composer using the windows installer and ticked the box that says install as developer (without including uninstall files), the I checked to see where it would install it and it showed my C:\ directory, so I accepted.
After successful install I opened new git bash in my project directory, and ran the
composer install
command. and it was successful.
I found a solution and it worked.
You have a COMPOSER environment variable defined and set to C:\ProgramData\ComposerSetup\bin.
You should unset/delete that env var.
You shouldnt erase the environment variable to work.
If the variable name was composer, you only must change the name to composerpath.
It's work to me.

Resources