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
Related
I've installed a fresh copy of High Sierra today (After resetting my whole mac) so now I am at the point of installing all things related to programming, like the Laravel installer for now.
I have problems with installing the laravel installer and with the path I suppose.
I know there are a lot of questions a bit similiar to this but for some reason I haven't found the right answer yet.
So as the documentation of Laravel said I installed composer and that works just fine. After that I installed the Laravel installer with composer. I placed the command(?) for my path in the .bashrc file but after a re open of my terminal the command Laravel was not found. I knew from previous times this thing was a pain in the ass and I am also not very familiar with all those things in the command line so this is kinda hard for me.
What I did:
1) I installed composer. After that, I did mv composer.phar /usr/local/bin/composer in my terminal. Also I did mkdir -p /usr/local/bin because i had a fresh install so those directories were not found of course, because they didn't exist.
2) After that I ran composer global require "laravel/installer" in my terminal. This was all going great.
3) Last step was to do this thing with the PATH. I still don't know if I did this right. What I did was nano ~/.bashrc and then added export PATH=~/.composer/vendor/bin:$PATH to this file. This did not work, so I still can't use Laravel .. in my terminal. I don't know much about this source command but when I do source ~/.bashrc I can use this Laravel command but when I open a new tab or window I can't use it anymore.
4) Besides export PATH=~/.composer/vendor/bin:$PATH in the .bashrc file I also tried export PATH="$HOME/.composer/vendor/bin:$PATH" in that file. that doesn't work either.
Is there someone that can help me out? Good to know is that I just installed a fresh copy of OS and did nothing besides installing some normal programms. Laravel/Composer were my first things with the terminal.
It might be that your terminal program is set to create a login shell, which doesn't source ~/.bashrc
Try adding this to ~/.bash_profile
[[ -f ~/.bashrc ]] && . ~/.bashrc
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/.
I've just got my new Macbook Pro, and installed Homestead on it. Followed this link: https://laravel.com/docs/master/homestead
I can view the site after installing Laravel on Homestead, but can't find where the files created are on my computer.
Here's homestead.yaml file
My browser
Code Folder
To check for any hidden files I've tried the same on Terminal
When I ssh into the Vagrant instance, I can see the file.
Where could the files be stored? Or am I looking at the wrong place? Thanks
I was able to fix it using the following steps.
I ran vagrant provision from the Homestead directory.
I was able to access the mac Code folder from ssh:
ssh vagrant#192.168.10.10
cd /home/Code
Just had to install Laravel again in this directory.
I think by default it is in your User folder. Mac HD/Users/yourname/Code
Check your command by which you create the project. It looks like:
$composer create-project laravel/laravel --prefer-dist your_project_name
If no error occurs, a directory named your_project_name would be created under your Code path.
Good luck!
Goal: install homestead so that I can install laravel
I am following the official instructions trying to install homestead.
I have so far on the Git Bash terminal:
Installed the vagrant box and Virtual box which works fine. Also added the laravel/homestead box to the vagrant installation
Cloned the Homestead Repo
Cloned the php7 brand of the Homestead Repo
Successfully ran 'bash init.sh'
Initialized Homestead by running "git clone -b php-7 https://github.com/laravel/homestead.git Homestead7
Now when I am trying to run:
box: laravel/homestead-7
The terminal gives me:
sh.exe": box:: command not found
Currently, the Homestead folder is sitting on the following path:
C:\Users\Gil.vagrant.d\boxes\homestead\Homestead
Does anyone know why this is happening and the solution?
What I have researched so far on Google but does not seem to address my particular problem:
cant-add-laravel-homestead-box-ssl-certificate-prob-windows
cant-install-vagrant-box-laravel-homestead
cant-add-laravel-homestead-box-ssl-certificate-prob-windows
the-box-laravel-homestead-could-not-be-found
You need to read more carefully:
Next, add then the box directive to the top of your ~/.homestead/Homestead.yaml file (on a new line after --- mark):
...
This means that you need to open the file named in a text editor and modify it.
I am trying to setup my first laravel project. I am running XAMPP for Linux (LAMPP) and I installed composer in /opt/lampp/bin/php.
I then cd /opt/lampp/htdocs
I then run: /opt/lampp/bin/php composer.phar create-project laravel/laravel new_proj --prefer-dist
Everything seems to be going great for the install then I get
Script php artisan optimize handling the post-install-cmd event returned with an error
[Runtime Exception]
Error Output: sh: 1: php: not found
I have PHP 5.4.
I think I understand the error but I don't know Laravel well enough to solve this. I have searched for this and can't seem to find an answer.
Also I can't seem to find a good starting point for trying to install this on XAMPP for Linux (LAMPP). Any help here would be greatly appreciated.
Problem was that I did not specify
/opt/lampp/bin
in my Path so it could not find PHP and more specifically it could not find the version of PHP that I was using in LAMPP. So I added
Path=$PATH:/opt/lampp/bin
to my ~/.bashrc file then I was able to successfully install laravel. Next issue that came up after that was setting permissions on the appropriate folders.
Permissions Problem, See Below:
Set permission for your project folder: sudo chmod 755 -R laravel_proj_name
Set permission for your project storage folder:
sudo chmod o+w -R laravel_proj_name/app/storage
Refresh Page, Good to Go!
I think the problem is that the PHP CLI binary is not in your path. Try adding it to your path or putting a symbolic link into /usr/bin or some other appropriate place.