You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[Accessing The Current Environment](#accessing-the-current-environment)
6
+
-[Determining The Current Environment](#determining-the-current-environment)
7
7
-[Configuration Caching](#configuration-caching)
8
8
-[Maintenance Mode](#maintenance-mode)
9
9
@@ -40,8 +40,8 @@ Your `.env` file should not be committed to your application's source control, s
40
40
41
41
If you are developing with a team, you may wish to continue including a `.env.example` file with your application. By putting place-holder values in the example configuration file, other developers on your team can clearly see which environment variables are needed to run your application.
42
42
43
-
<aname="accessing-the-current-environment"></a>
44
-
### Accessing The Current Environment
43
+
<aname="determining-the-current-environment"></a>
44
+
### Determining The Current Environment
45
45
46
46
The current application environment is determined via the `APP_ENV` variable from your `.env` file. You may access this value via the `environment` method on the `App`[facade](/docs/{{version}}/facades):
Laravel strives to make the entire PHP development experience delightful, including your local development environment. [Vagrant](http://vagrantup.com) provides a simple, elegant way to manage and provision Virtual Machines.
22
22
23
-
Laravel Homestead is an official, pre-packaged Vagrant "box" that provides you a wonderful development environment without requiring you to install PHP, HHVM, a web server, and any other server software on your local machine. No more worrying about messing up your operating system! Vagrant boxes are completely disposable. If something goes wrong, you can destroy and re-create the box in minutes!
23
+
Laravel Homestead is an official, pre-packaged Vagrant box that provides you a wonderful development environment without requiring you to install PHP, HHVM, a web server, and any other server software on your local machine. No more worrying about messing up your operating system! Vagrant boxes are completely disposable. If something goes wrong, you can destroy and re-create the box in minutes!
24
24
25
-
Homestead runs on any Windows, Mac, or Linux system, and includes the Nginx web server, PHP 5.6, MySQL, Postgres, Redis, Memcached, Node, and all of the other goodies you need to develop amazing Laravel applications.
25
+
Homestead runs on any Windows, Mac, or Linux system, and includes the Nginx web server, PHP 7.0, MySQL, Postgres, Redis, Memcached, Node, and all of the other goodies you need to develop amazing Laravel applications.
26
26
27
27
> **Note:** If you are using Windows, you may need to enable hardware virtualization (VT-x). It can usually be enabled via your BIOS.
28
28
29
-
Homestead is currently built and tested using Vagrant 1.7.
30
-
31
29
<aname="included-software"></a>
32
30
### Included Software
33
31
34
32
- Ubuntu 14.04
35
33
- Git
36
-
- PHP 5.6 / 7.0
37
-
- Xdebug
34
+
- PHP 7.0
38
35
- HHVM
36
+
- Xdebug
39
37
- Nginx
40
38
- MySQL
41
39
- Sqlite3
42
40
- Postgres
43
41
- Composer
44
42
- Node (With PM2, Bower, Grunt, and Gulp)
45
43
- Redis
46
-
- Memcached (PHP 5.x Only)
44
+
- Memcached
47
45
- Beanstalkd
48
-
-[Laravel Envoy](/docs/{{version}}/envoy)
49
46
-[Blackfire Profiler](#blackfire-profiler)
50
47
51
48
<aname="installation-and-setup"></a>
@@ -56,66 +53,37 @@ Homestead is currently built and tested using Vagrant 1.7.
56
53
57
54
Before launching your Homestead environment, you must install [VirtualBox 5.x](https://www.virtualbox.org/wiki/Downloads) or [VMWare](http://www.vmware.com) as well as [Vagrant](http://www.vagrantup.com/downloads.html). All of these software packages provide easy-to-use visual installers for all popular operating systems.
58
55
59
-
To use the VMware provider, you will need to purchase both VMware Fusion / Workstation and the [VMware Vagrant plug-in](http://www.vagrantup.com/vmware). VMware provides much faster shared folder performance out of the box.
56
+
To use the VMware provider, you will need to purchase both VMware Fusion / Workstation and the [VMware Vagrant plug-in](http://www.vagrantup.com/vmware). Though it is not free, VMware can provide faster shared folder performance out of the box.
60
57
61
58
#### Installing The Homestead Vagrant Box
62
59
63
60
Once VirtualBox / VMware and Vagrant have been installed, you should add the `laravel/homestead` box to your Vagrant installation using the following command in your terminal. It will take a few minutes to download the box, depending on your Internet connection speed:
64
61
65
62
vagrant box add laravel/homestead
66
63
67
-
If this command fails, you may have an old version of Vagrant that requires the full URL:
If this command fails, make sure your Vagrant installation is up to date.
70
65
71
-
#### Cloning The Homestead Repository
66
+
#### Installing Homestead
72
67
73
68
You may install Homestead by simply cloning the repository. Consider cloning the repository into a `Homestead` folder within your "home" directory, as the Homestead box will serve as the host to all of your Laravel projects:
Once you have cloned the Homestead repository, run the `bash init.sh` command from the Homestead directory to create the `Homestead.yaml` configuration file. The `Homestead.yaml` file will be placed in your`~/.homestead` directory:
74
+
Once you have cloned the Homestead repository, run the `bash init.sh` command from the Homestead directory to create the `Homestead.yaml` configuration file. The `Homestead.yaml` file will be placed in the`~/.homestead` hidden directory:
82
75
83
76
bash init.sh
84
77
85
-
<aname="upgrading-to-php-7"></a>
86
-
#### Upgrading To PHP 7.0
87
-
88
-
If you are already using the PHP 5.x Homestead box, you may easily upgrade your installation to PHP 7.0. First, clone the `php-7` branch of the `laravel/homestead` repository into a new folder:
If you already have a `Homestead.yaml` file in your `~/.homestead` directory, there is no need to run the `init.sh` script. However, if this is the first and only Homestead installation on your machine, you should run `bash init.sh` from your new Homestead directory.
93
-
94
-
Next, add then the `box` directive to the top of your `~/.homestead/Homestead.yaml` file (on a new line after `---` mark):
95
-
96
-
box: laravel/homestead-7
97
-
98
-
Finally, you may run the `vagrant up` command from the directory that contains your new clone of the `laravel/homestead` repository.
99
-
100
78
<aname="configuring-homestead"></a>
101
79
### Configuring Homestead
102
80
103
81
#### Setting Your Provider
104
82
105
-
The `provider` key in your `Homestead.yaml` file indicates which Vagrant provider should be used: `virtualbox`, `vmware_fusion`, or `vmware_workstation`. You may set this to whichever provider you prefer:
83
+
The `provider` key in your `~/.homestead/Homestead.yaml` file indicates which Vagrant provider should be used: `virtualbox`, `vmware_fusion`, or `vmware_workstation`. You may set this to the provider you prefer:
106
84
107
85
provider: virtualbox
108
86
109
-
#### Setting Your SSH Key
110
-
111
-
In the `Homestead.yaml` file, you should also configure the path to your public SSH key. Don't have an SSH key? On Mac and Linux, you can generally create an SSH key pair using the following command:
112
-
113
-
ssh-keygen -t rsa -C "you@homestead"
114
-
115
-
On Windows, you may install [Git](http://git-scm.com/) and use the "Git Bash" shell included with Git to issue the command above. Alternatively, you may use [PuTTY](http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html) and [PuTTYgen](http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html).
116
-
117
-
Once you have created a SSH key, specify the public key's path in the `authorize` property of your `Homestead.yaml` file.
118
-
119
87
#### Configuring Shared Folders
120
88
121
89
The `folders` property of the `Homestead.yaml` file lists all of the folders you wish to share with your Homestead environment. As files within these folders are changed, they will be kept in sync between your local machine and the Homestead environment. You may configure as many shared folders as necessary:
@@ -146,15 +114,13 @@ You can make any Homestead site use [HHVM](http://hhvm.com) by setting the `hhvm
146
114
to: /home/vagrant/Code/Laravel/public
147
115
hhvm: true
148
116
149
-
By default, each site will be accessible by HTTP via port 8000 and HTTPS via port 44300.
150
-
151
117
#### The Hosts File
152
118
153
-
Don't forget to add the "domains" for your Nginx sites to the `hosts` file on your machine! The `hosts` file will redirect your requests for the local domains into your Homestead environment. On Mac and Linux, this file is located at `/etc/hosts`. On Windows, it is located at `C:\Windows\System32\drivers\etc\hosts`. The lines you add to this file will look like the following:
119
+
You must add the "domains" for your Nginx sites to the `hosts` file on your machine. The `hosts` file will redirect your requests for the local domains into your Homestead environment. On Mac and Linux, this file is located at `/etc/hosts`. On Windows, it is located at `C:\Windows\System32\drivers\etc\hosts`. The lines you add to this file will look like the following:
154
120
155
121
192.168.10.10 homestead.app
156
122
157
-
Make sure the IP address listed is the one you set in your `Homestead.yaml` file. Once you have added the domain to your `hosts` file, you can access the site via your web browser!
123
+
Make sure the IP address listed is the one set in your `~/.homestead/Homestead.yaml` file. Once you have added the domain to your `hosts` file, you can access the site via your web browser:
158
124
159
125
http://homestead.app
160
126
@@ -168,7 +134,7 @@ To destroy the machine, you may use the `vagrant destroy --force` command.
168
134
<aname="per-project-installation"></a>
169
135
### Per Project Installation
170
136
171
-
Instead of installing Homestead globally and sharing the same Homestead box across all of your projects, you may instead configure a Homestead instance for each specific project. Installing Homestead per project may be beneficial if you wish to ship a `Vagrantfile`directly within your project, allowing others working on the project to simply `vagrant up`.
137
+
Instead of installing Homestead globally and sharing the same Homestead box across all of your projects, you may instead configure a Homestead instance for each project you manage. Installing Homestead per project may be beneficial if you wish to ship a `Vagrantfile`with your project, allowing others working on the project to simply `vagrant up`.
172
138
173
139
To install Homestead directly into your project, require it using Composer:
174
140
@@ -189,28 +155,35 @@ Next, run the `vagrant up` command in your terminal and access your project at `
189
155
<aname="daily-usage"></a>
190
156
## Daily Usage
191
157
158
+
<aname="accessing-homestead-globally"></a>
159
+
### Accessing Homestead Globally
160
+
161
+
Sometimes you may want to `vagrant up` your Homestead machine from anywhere on your filesystem. You can do this by adding a simple Bash alias to your Bash profile. This alias will allow you to run any Vagrant command from anywhere on your system and will automatically point that command to your Homestead installation:
Make sure to tweak the `~/Homestead` path in the alias to the location of your actual Homestead installation. Once the alias is installed, you may run commands like `homestead up` or `homestead ssh` from anywhere on your system.
166
+
192
167
<aname="connecting-via-ssh"></a>
193
168
### Connecting Via SSH
194
169
195
170
You can SSH into your virtual machine by issuing the `vagrant ssh` terminal command from your Homestead directory.
196
171
197
-
But, since you will probably need to SSH into your Homestead machine frequently, consider creating an "alias" on your host machine to quickly SSH into the Homestead box. Once you create this alias, you can simply use the "vm" command to SSH into your Homestead machine from anywhere on your system:
But, since you will probably need to SSH into your Homestead machine frequently, consider adding the "alias" described above to your host machine to quickly SSH into the Homestead box.
200
173
201
174
<aname="connecting-to-databases"></a>
202
175
### Connecting To Databases
203
176
204
-
A `homestead` database is configured for both MySQL and Postgres out of the box. For even more convenience, Laravel's `local` database configuration is already set to use this database by default.
177
+
A `homestead` database is configured for both MySQL and Postgres out of the box. For even more convenience, Laravel's `.env` file configures the framework to use this database out of the box.
205
178
206
-
To connect to your MySQL or Postgres database from your host machine via Navicat or Sequel Pro, you should connect to `127.0.0.1` and port 33060 (MySQL) or 54320 (Postgres). The username and password for both databases is `homestead` / `secret`.
179
+
To connect to your MySQL or Postgres database from your host machine via Navicat or Sequel Pro, you should connect to `127.0.0.1` and port `33060` (MySQL) or `54320` (Postgres). The username and password for both databases is `homestead` / `secret`.
207
180
208
-
> **Note:** You should only use these non-standard ports when connecting to the databases from your host machine. You will use the default 3306 and 5432 ports in your Laravel database configuration file since Laravel is running _within_ the Virtual Machine.
181
+
> **Note:** You should only use these non-standard ports when connecting to the databases from your host machine. You will use the default 3306 and 5432 ports in your Laravel database configuration file since Laravel is running _within_ the virtual machine.
209
182
210
183
<aname="adding-additional-sites"></a>
211
184
### Adding Additional Sites
212
185
213
-
Once your Homestead environment is provisioned and running, you may want to add additional Nginx sites for your Laravel applications. You can run as many Laravel installations as you wish on a single Homestead environment. To add an additional site, simply add the site to your `Homestead.yaml` file and then run the `vagrant provision` terminal command from your Homestead directory.
186
+
Once your Homestead environment is provisioned and running, you may want to add additional Nginx sites for your Laravel applications. You can run as many Laravel installations as you wish on a single Homestead environment. To add an additional site, simply add the site to your `~/.homestead/Homestead.yaml` file and then run the `vagrant provision` terminal command from your Homestead directory.
214
187
215
188
<aname="configuring-cron-schedules"></a>
216
189
### Configuring Cron Schedules
@@ -248,11 +221,6 @@ If you wish, you may forward additional ports to the Vagrant box, as well as spe
248
221
to: 777
249
222
protocol: udp
250
223
251
-
<aname="bash-aliases"></a>
252
-
### Bash Aliases
253
-
254
-
To add additional Bash aliases to your Homestead box, edit the `aliases` file in your Homestead directory. These aliases will automatically be defined on the Homestead box when it starts.
0 commit comments