Receiving bash Homestead command not found
//After running composer global require "laravel/homestead=~2.0"
Changed current directory to C:/Users/Eric/AppData/Roaming/Composer
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files
//Inside my vi ~/.zshrc
export PATH=/Users/eric/AppData/Roaming/composer/vendor/bin:$PATH
export PATH="$laravel:$PATH"
I enabled Virtualization in BIOS
// Inside etc/hosts
Hosts:
127.0.0.1 homestead.app
192.168.10.10 homestead.app
//Inside environmental variables
C:\Users\Eric\AppData\Roaming\composer\vendor\bin
I can't find the homestead.yaml folder and I can't run any homestead commands. Any help with this would be appreciated, thanks!
Assuming that you already have VirtualBox, Vagrant, Git Bash (Git for Windows) installed and working you have two options to install Homestead
Using Git Bash:
Open git bash, navigate to home directory (typically it's C:\Users\{username}) and run
git clone https://github.com/laravel/homestead.git Homestead.
This will download Homestead in C:\Users\{username}\Homestead directory.
Then go to the Homestead installation directory
cd ~/Homestead and run bash init.sh.
This last command will create the Homestead configuration file (homestead.yaml).
Using composer
You need to have PHP and Composer already installed.
Open git bash and run composer global require "laravel/homestead=~2.0" command.
To take advantage of the Homestead CLI, make sure to add the Composer /bin directory to your PATH e.g. command prompt with admin privileges:
set PATH=%PATH%;%USERPROFILE%\AppData\Roaming\Composer\vendor\bin
Then to create the Homestead configuration file (homestead.yaml) you have to run homestead init.
If none of the above don't work you can use Laragon http://laragon.org/.
Related
I am trying to run openEMR project in Eclipse on my Ubuntu 18.04 machine. I have downloaded the project and installed the dependencies using below command.
composer install --no-dev
npm install
npm run build
composer dump-autoload -o
I followed this tutorial to run the application but still I got the below error.
The project is present inside this folder.
And the configurations in Eclipse are:
I tried like below as well:
What am I missing here?
You are accessing a resource in your web browser which does not exist in your apache2.
The directory public_html is your Document Root. Therefore, you have to specify a resource that is relative to your Document Root.
Try
http://localhost/openemr-6_0_0/index.php
i have an issue that's occur,when i tried to use this command
composer require
in git bash this error occurs
enter image description here
Please tell me how i install my vendor packages.
I'll just leave this here. This worked for me.
Assuming composer is already available globally(if not, install composer globally first) in your path and it is working perfectly fine in your cmd.
And you are only having problems on git bash.
open cmd.
where composer
//outputs something like: C:\xampp\php\composer.bat
//mine is located in C:\xampp\php directory
go to composer directory
cd C:\xampp\php
make sure composer.phar is inside the directory
ls
outputs something like:
.
..
composer.bat
composer.phar
etc.
composer.phar is found. jackpot.
Your cmd is running the composer.bat file. git bash doesn't run .bat files so it throws an error.
Now just copy composer.phar into composer (no extension)
cp composer.phar composer
open git git bash and then:
composer --version
You're all set.
I ran sudo nano .bashrc and added
export PATH="~/.composer/vendor/bin:$PATH"
I restarted my terminal, ran laravel and received
laravel: command not found
I had run this prior to the above
composer global require laravel/installer
Also tried executing what I added to .bashrc in the terminal directly.
echo $PATH prints
/home/dev/.composer/vendor/bin:~/.composer/vendor/bin:~/.composer/vendor/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
The directory that Composer uses to store global binaries can be configured, and its default value depends on your operating system. You can see what it's set to by running
composer global config bin-dir --absolute
On your machine that outputs
/home/dev/.config/composer/vendor/bin
so that's what you should add to your PATH:
export PATH="~/.config/composer/vendor/bin:$PATH"
See also:
Why is COMPOSER_HOME empty?, which touches on one reason why you might see ~/.composer/ on some machines and ~/.config/composer/ on others.
I have been trying to install composer on my Mac (running macOS Sierra). The composer.phar file is now located in /usr/local/bin/composer/ and it works properly when I'm not running composer as a root.
$ composer -V
Composer version 1.2.4 2016-12-06 22:00:51
However, when I try to run composer as a root (which of course is required to install dependencies), I get this:
$ sudo composer
sudo: composer: command not found
I have no single clue how to fix it, has anyone else had this?
it must be a composer.phar renamed to composer into /usr/local/bin/ , not a directory composer/
From : https://getcomposer.org/doc/00-intro.md
Globally#
You can place the Composer PHAR anywhere you wish. If you put it in a directory that is part of your PATH, you can access it globally. On unixy systems you can even make it executable and invoke it without directly using the php interpreter.
After running the installer following the Download page instructions you can run this to move composer.phar to a directory that is in your path:
mv composer.phar /usr/local/bin/composer
Note: If the above fails due to permissions, you may need to run it again with sudo.
Note: On some versions of OSX the /usr directory does not exist by default. If you receive the error "/usr/local/bin/composer: No such file or directory" then you must create the directory manually before proceeding:
mkdir -p /usr/local/bin
Note: For information on changing your PATH, please read the Wikipedia article and/or use Google.
Now just run composer in order to run Composer instead of php composer.phar.
I was following these instructions to install homestead on my Mac
http://pastebin.com/48PHSNC2
Homestead installed properly, but when it initialized, it didn't create a Homestead.yaml file. I have no idea how to reinitialize homestead or fix this. Reading through the installation guide Laravel gives you, it suggests using $ bash init.sh to create the .yaml file... unfortunately, this apparently doesn't exist for me either.
I used the composer command to install the CLI:
composer global require "laravel/homestead=~2.0"
Any ideas? I'm stumped...
I ran into a similar issue using Homestead 2.X (I dont care for Homestead 3 ATM).
basically do the following:
find the bash_init.sh file by running sudo find / -name init.sh
cd into the directory it's in, mine was in /Users/me/.composer/vendor/laravel/homestead/init.sh
make it executable, by running chmod +x init.sh
run ./init.sh
...
profit!
You can generate manually by clone git clone https://github.com/laravel/homestead.git Homestead. This will generate homestead.yaml file. Open and edit and change the parameters to fit your system configuration. For further reading
https://dev.to/ko31/installing-laravel-homestead-on-macos-5910