I'm getting an error saying:
failed to clone https://github.com/php-fig/log.git, git was not found, check that it is installed and in your PATH env.
'git' is not recognized as and internal or external command, operable program or batch file
when I try and run composer create-project laravel/laravel learning-laravel.
I installed the git GUI which also comes with a command line shell, but I don't know why its not recognising the command (I'm issuing the create-project command in the normal windows command line prompt).
I also tried running the command from the git shell, which worked, but when I tried php artisan serve it gave me an error saying CLI has stopped working.
Does anyone know how to fix the git error? I'd rather use the windows command shell instead of the git one as it can then go into my wamp/www file
You need to add the directory you installed git to to your PATH environment variable.
Right click on Computer.
Click Advanced System Settings
Click Environment Variables inside the Advanced Menu
Under System Variables, scroll to PATH
Add ;"C:\path\to\git\bin";"C:\path\to\git\cmd"
Test the git command in the command prompt to see if it worked. Git is usually located in Program Files or Program Files(x86).
There is an easier (but temporal) way to add a path variable in Windows.
Paste this in your command prompt:
SET PATH=%PATH%;C:\Program Files\Git\bin
This will work for the rest of the command prompt session. Don't forget installing Git before this.
You'll need to add git to your system PATH if you want to use it in regular command prompt.
Here's a guide on modifying your system path in Windows:
http://www.computerhope.com/issues/ch000549.htm
you need to uninstall git and reinstall ( or update ) in the options you need to change from git bash only to allow git to be added to command line as well, also since it then adds it to your path you may or may not need to restart your computer
I was having some issues using git on Windows. I found this information only and it worked for me.
http://ccn.ucla.edu/wiki/index.php/Setting_Up_and_Using_Git#Windows
Related
I get the error in the title when I try to run composer require "illuminate/html":"5.0.*" in my terminal (Git Bash) under my current project file path. Even if I type something like composer -v I get the same error.
I've even tried reinstalling composer and it installs fine but the commands still don't work.
In the PhpSTORM terminal, running the same commands gives this error: 'composer' is not recognized as an internal or external command, operable program or bath file.
I have VirtualBox, Vagrant and Laravel all installed correctly with Composer (I know it's all good because my code is great and works fine when trying it live and what not)... unless I'm missing something here (Laravel noob).
Why is this happening?
If you installed composer outside your virtual box (in your host system) and you want to use it without ssh into your vagrant box:
Make sure you add composers directory to your PATH. Then close your current terminal and reload a new one. Closing the terminal is necessary to reload the PATH.
The error sh.exe": composer: command not found indicates that the composer is not found in the current folder or the PATH.
Found out why I was getting the error: forgot to ssh.
The fix was this: vagrant ssh in the terminal.
I'm trying to install Laravel Homestead in order to be able to test my Laravel projects locally.
I'm following this tutorial: http://laravel.com/docs/4.2/homestead
In the "Installing Homestead" part I followed the second step "Manually Via Git (No Local PHP)",I don't have any PHP installed locally and can't use Composer. (Wasn't PHP supposed to be installed as part of Homestead?)
I got to this part:
Once you have installed the Homestead CLI tool, run the bash init.sh command to create the Homestead.yaml configuration file:
bash init.sh
In command prompt I tried to enter the following command:
bash init.sh
I got the following error:
'bash' is not recognized as an internal or external command, operable program or batch file.
Then I tried to enter the same command in Git Bash, and I got the following error:
bash: init.sh: No such file or directory
When I tried to enter in Git Bash simply
init.sh
I got the following error:
sh.exe": init.sh: command not found
I ran into this problem well. You need to hop into your terminal (I am on Mac.)
Type into your console: cd ~/Homestead
and to make sure you are in your newly generated Homestead folder (you can always click Finder > your home directory > Homestead to confirm it's where it should be),
then while in terminal simply type ls -- if it lists all of the files like Vagrantfile, composer.lock and bash init.sh, you should be in.
Once you know you are in the correct Homestead folder, it is now at that point in which you run bash init.sh
After doing this it now says Homestead initialized!
.sh is a unix/linux script executable, that isn't recognized on Windows. There's a init.bat included in the package, but it isn't referenced in the tutorial.
Just run init.bat from the command line. It will copy the files to:
%HOMEDRIVE%%HOMEPATH%\.homestead
You need install Git Bash, and then run commands into Git Bash.
Try init.bat that worked for me
If the init.bat refused to work
Go to the Homestead folder.
C:/Users/Computer Name/Homestead
You will see init.bat: double click to run it.
Problem solved.
I found the answer you may be looking for. I was having the same problems with this. Just make sure at the end of bash init.sh you put a ;
So in the git bash cmd you will have this line
$ bash init.sh;
Just do it using sudo.
$sudo bash init.sh
I m new to php and rabbitmq in debian(Linux). I have installed xampp, rabbitmq and also installed composer.phar in project directory using below command
/opt/lampp/htdocs/rabbitmq_demo# curl -s https://getcomposer.org/installer | /opt/lampp/bin/php
Now I use Composer to install the dependencies of the project using below command
composer.phar install
but it thrown an error as below
bash: php: command not found
I have preferred the link https://getcomposer.org/doc/00-intro.md
I want to prepare autoload.php
Please help me to create autoload under vendor directory.
You do not have a php cli program installed on your computer or it is not in your current $PATH variable. Please install PHP first or correct your $PATH environment variable.
Once you have this, run the composer.phar install again. This will download all dependencies listed in your composer.json file. Once the program completes, you will have a file ``vendor/autoload.php`. You can just require this file at the beginning of your own script and everything will be taken care of.
You need to add the path to the PHP command line (CLI) in the XAMPP install, to your bash environment. (You'd think the installer would do this!)
The XAMPP PHP CLI on Debian is at /opt/lampp/bin/php
So you need to add /opt/lampp/bin to your $PATH environment variable.
See this answer for the various options in modifying your path depending on who you want to be able to run PHP.
/etc/login.defs
/etc/environment
/etc/profile
~/.bashrc
In one of those files, you append to the path thus:
PATH=$PATH:/opt/lampp/bin
and re-login.
I am currently working with symfony2 and I want to launch to download the libraries I need. I know the command in linux is "$ ./composer.phar update --dev" however when I run this in windows it prompts whether I should open the file with the windows explorer or not. I currently have composer.phar installed on windows but I am having trouble launching it. How would I be able to update my symfony2 folder with the dependencies I need. Thank you.
In CMD:
php C:\ProgramData\ComposerSetup\bin\composer.phar self-update
The problem is that Windows don't know how to open .phar files. You need to execute them using php interpreter php composer.phar update and the php interpreter(php.exe) must be accessible on PATH.
You could use command php -v to check if your php is accessible from command line.
Go to C:\ProgramData\ComposerSetup\bin\composer.phar
In CMD write php composer.phar (update) or (self-update)
1: Open cmd
First go to your work directory like if you have wamp then c:/wamp/www.
Then enter composer if you can see list of composer command then its good.
Now type "composer self-update".
5: Next you can see the process.
This worked for me on my Centos server
sudo -u nginx php composer.phar update
I am trying to use composer on command line :
php composer.phar update
php composer.phar install
php composer.phar self-update
php composer.phar selfupdate
Whatever I do I always receive the same error message:
File could not be downloaded. Failed to open stream
I am behind a proxy. If I use a browser and type the same URLs as the ones that didn't work with command line, there is no problem.
What should I do?
If you are using composer from behind an HTTP proxy, you can use the standard http_proxy or HTTP_PROXY env vars. Simply set it to the URL of your proxy. Many operating systems already set this variable for you.
eg:
HTTP_PROXY="http://my-corp-proxy.mcdonalds" php composer.phar install
bonus points if you throw it into your bashrc if your on Linux/OS X or your environment settings for Windows.
To make it easier, you can just export the variable, then you don't have to type it all the time.
export HTTP_PROXY="http://my-corp-proxy.mcdonalds"
php composer.phar install
The right an easy way to run composer on windows under a proxy is opening the console (cmd), go to your project location and run this command:
C:\wamp\htdocs\myproject\> SET HTTP_PROXY=http://username:password#proxy.yourdomain.com:8080 && php composer.phar install
PD: You must changes parameters like: username, password, proxy.yourdomain.com and 8080 to yours
I hope this help to you
And DO NOT set https_proxy (just http_proxy)!