Composer installation issue on windows 8.1 - php

I am trying to download laravel project via composer on microsoft windows 8.1.
But I am unable to download because I receive APPDATA COMPOSER_HOME environment variable issue for this I uninstall the composer from my system and try to re install the latest version of composer on windows 8.1 but I still receiving following error
The APPDATA or COMPOSER_HOME environment variable must be set for composer to run correctly
How to solve this problem? I also searched on google but no useful solution found.

If you are on windows, then it would be better to install the composer using their setup:
https://getcomposer.org/Composer-Setup.exe
This should take care of installing and setting the paths correctly. If you've installed it manually, run this command to set the path before using composer:
Set COMPOSER_HOME="C:\path\to\where\composer\installed"

try this command bro in your cmd prompt.
SET COMPOSER_HOME="C:\path\to\composer"
composer self-update

Related

Configuring Remote (WSL) Composer in PhpStorm

I'm trying to configure a PhpStorm project to utilize both remote PHP and a remote Composer. Remote being my Windows Subsystem for Linux (WSL) installation. However, when I initiate any Composer commands from PhpStorm, I get errors. And unfortunately, the errors are not very indicative of the cause or offer a link for additional details.
Errors received in my "Event Log":
12:21 PM Composer
Failed to install packages for ./composer.json.
Show in Log
And in my "Composer Log":
install --no-interaction --no-ansi
/bin/sh: 1: composer: not found
Failed to install packages for ./composer.json.
So far, I've followed the instructions located at:
https://www.jetbrains.com/help/phpstorm/how-to-use-wsl-development-environment-in-product.html
https://www.jetbrains.com/help/phpstorm/configuring-remote-interpreters.html
I also followed the answer at this post to set WSL as my default terminal:
How to use WSL as default terminal in WebStorm or any other JetBrains' products?
In my WSL installation, composer is located at /home/<user>/.local/bin/composer and is included in my path upon login in my /home/<user>/.profile file. And I was sure to restart PhpStorm after doing so to ensure it has the updated path. Additionally, running composer install within my project, on WSL works without issue.
I'm not sure how to determine which terminal or composer file PhpStorm is using. Either it's still trying to find and use a composer on my host Windows install (which doesn't exist) or I'm missing a path which I have to map for WSL.
Any idea how I can obtain more details as to what I have misconfigured?
I figured out my issue.
When in Settings -> PHP -> Composer, in the "Execution" section. I was already selecting "Remote Interpreter", but the "Composer executable" field requires an absolute path. I was simply supplying the name of the executable since the field is asking for the executable.
I just figured it would utilize my $PATH to resolve the executable, but this isn't using an SSH session so it wouldn't have my custom $PATH values. So it all makes sense.

Not able to install symfony on windows

Hello I am trying to install symfony on Windows. I had follow the all require steps for it but it end up with below message.
[RuntimeException]
Symfony can't be installed because the downloaded package is corrupted.
To solve this issue, try executing this command again:
Symfony new demo 3.2.8
When i tried above command it says :
'symfony' is not recognized as an internal or external command,
operable program or batch file.
I have try to reinstall composer and Symfony package both but it does not resolve the issue. It stays the same issue again.
Please help me how can I install it on Windows.
You are required to make it run through PHP as its a script file.
This gets the installer (which it looks like you have already)
php -r "readfile('https://symfony.com/installer');" > symfony
Then php symfony new demo 3.2.8 (asuming if php is in path otherwise you have to specify the php.exe path too)
For the full details see http://symfony.com/doc/current/setup.html
Regards
forget about that installer use composer from command line
composer create-project symfony/framework-standard-edition my_project_name
BTW i don't know what server you are using (wamp/xamp etc), i recomending this
https://laragon.org/
it have composer and all tools that you need to start with symfony

error using composer to install cakePHP 3

i am lost...
i am trying to do it the right way and am following the Quick Start Guide for installing cakePHP 3 on my ubuntu machine.
Got composer installed. Directory is /var/www/cakephp
and am trying to issue:
php composer.phar create-project --prefer-dist cakephp/app mayapp
or
composer create-project --prefer-dist cakephp/app may app
then i am simply getting:
[InvalidArgumentException]
Could not find package cakephp/app with stability stable.
i do not have a clue what i am doing wrong. Any suggestions?
cakephp/app exists on https://packagist.org, and the command looks ok to me.
Which PHP version are you using? That package is only available with PHP 5.4.16 or later, so you must update if you want to use CakePHP.
However, it is a good idea to only use the same PHP version of your public hosting, using a newer version will lead to problems when deploying your code. If your webspace or public server does not have the latest PHP 5.6 running, ask for an update.
I got same issue. But, as previous answer, myapp does not exists on packagist.org, so, you must use laravel/laravel instead, and, after created, rename the new laravel folder to your desired name and move to htdocs (for xampp) or www (for wamp), then, and I do not know why, go to : localhost/laravel/public/
and replace laravel with the name you gave to your project folder instead the laravel one.
You will see Laravel 5 fonts will appear on screen.
That's means Laravel is running.
Hey Please try these steps.
Download XAMPP Server.
Install XAMPP server.
Go to ..\xampp\php\php.ini and open.
Add this line (extension=php_intl.dll) or if exist uncomment.
Download Composer setup from https://github.com/composer/windows-setup/releases/
Install composer and give php.exe file in path
Open cmd and check now php version using command php -v. if its showing php version its means its working.
Now open cmd and cd on xampp\htdocs folder & run command composer create-project --prefer-dist cakephp/app app_name
Finished folder created in htdocs.
Hope this is helpful for you.

Error in Composer install using Wamp and Windows 7

I tried to update my composer to install new packages and got this
the APPDATA or COMPOSER_HOME environment variable must be set up for composer to run correctly
cant seem to find anything on it in google or the IRC
You can use Laragon, a modern isolated WAMP to avoid seeing errors like that.
Laragon bundles composer, Memcached, Redis, it has many useful features over WAMP and fully supports Laravel.
To run composer, just open Laragon's Shell and type composer
In your cmd prompt.
SET COMPOSER_HOME="C:\path\to\composer"
composer self-update
This article shows you how to set an environment variable to always be available.
I feel this is missing for few of the windows user.
What you can do is define the APPDATA env var yourself, it should point to C:\Users*YOUR USERNAME*\AppData\Roaming on vista/7 (and I guess win8)
https://github.com/composer/composer/issues/2033

Installing Laravel

I am on a windows 8 machine and I'm trying to learn laravel. I copy and pasted my PHP folder from C:\xampp to C:\php, installed composer, ran composer install then composer create-project laravel/laravel learning-laravel. So far everything was created so I went into the directory and tried to use 'php artisan serve' and got the following error.
C:\Users\denni_000\learning-laravel>php artisan serve
Warning: require(C:\Users\denni_000\learning-laravel\bootstrap/../vendor/autoloa
d.php): failed to open stream: No such file or directory in C:\Users\denni_000\l
earning-laravel\bootstrap\autoload.php on line 17
Why you copied php folder
download composer install it.
download laravel latest version and store it on your xampp/htdocs/laravel
and run cmd with composer install command
For more follow install laravel on windows xampp
or Laravel 4.1 installation with composer in xampp
For windows Simply download Laragon which includes latest php 5.6.7, Apache, Mysql, Redis, Memcached an alternative to Xampp or Mamp with small size. Easy to install laravel and create project with auto create virtual host by it. Thank you.
U need to go to the directory where laravel is installed and run the following command.
composer update
Install Laravel 4.2 with composer:
sudo composer.phar create-project laravel/laravel project-directory-name 4.2 --prefer-dist
Here is a different way to setup laravel, may be you guys will like it
Step 1:
Clone https://github.com/laravel/laravel or you may download zip also.
Step 2:
Navigate to downloaded folder in command prompt and run composer install
Step 3:
open the folder and rename .env.example to .env and update the credentials mentioned in file.
Step 4:
After these steps if you navigate to the directory from web-server it will cause an error No supported encrypter found. The cipher and / or key length are invalid. to fix this just run php artisan key:generate
Done!
Hope you guys like this way :)
You need to install all the laravel required dependency.
To do that, you need to tell composer to install everything needed.
Below is the command to use to install that's required in laravel composer.json.
composer install
Follow the installation guide from Laravel
Install Composer:
Like Laravel.com says: "Make sure to place the ~/.composer/vendor/bin directory in your PATH so the laravel executable can be located by your system."
Type the following statement in the command line:
composer global require "laravel/installer=~1.1"
Create a fresh Laravel project in a specified directory with the "laravel new" command:
laravel new blog
You can also create a Laravel project using composer, like such:
composer create-project laravel/laravel --prefer-dist
If you want to learn laravel I seriously recommend you use laravel homestead with vagrant.
For this you need to:
Install virtualbox.
Install vagrant.
Install git.
Install ssh.exe (Download msysgit and copy the content of bin folder to git bin folder).
Install Homestead on Vagrant (Follow the steps on laravel/homestead documentation page).
Install Laravel on Homestead (Follow the steps on laravel/installation documentation page).
This method apply to Windows, Linux or Mac, only change the step 4 on linux or mac.

Categories