Skip to content

Commit d23fa0e

Browse files
committed
Added doc about Homestead's Symfony integration
1 parent 79775ae commit d23fa0e

File tree

3 files changed

+68
-0
lines changed

3 files changed

+68
-0
lines changed

cookbook/map.rst.inc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,3 +245,4 @@
245245

246246
* :doc:`/cookbook/workflow/new_project_git`
247247
* :doc:`/cookbook/workflow/new_project_svn`
248+
* :doc:`/cookbook/workflow/homestead`

cookbook/workflow/homestead.rst

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
.. index:: Vagrant, Homestead
2+
3+
Using Symfony with Homestead/Vagrant
4+
====================================
5+
6+
In order to develop a Symfony application, you might want to use a virtual
7+
development environment instead of the built-in server or WAMP/LAMP. Homestead_
8+
is an easy-to-use Vagrant_ box to get a virtual environment up and running
9+
quickly.
10+
11+
Install Vagrant and Homestead
12+
-----------------------------
13+
14+
Before you can use Homestead, you need to install and configure Vagrant and
15+
Homestead as explained in `the Homestead documentation`_.
16+
17+
Setting Up a Symfony Application
18+
--------------------------------
19+
20+
Imagine you've installed your Symfony application in
21+
``~/projects/symfony_demo`` on your local system. You first need Homestead to
22+
sync your files in this project. Execute ``homestead edit`` to edit the
23+
Homestead configuration and configure the ``~/projects`` directory:
24+
25+
.. code-block:: yaml
26+
27+
# ...
28+
folders:
29+
- map: ~/projects
30+
to: /home/vagrant/projects
31+
32+
The projects directory is now accessible at ``/home/vagrant/projects`` in the
33+
Homestead environment.
34+
35+
After you've done this, configure the Symfony application in the Homestead
36+
configuration:
37+
38+
.. code-block:: yaml
39+
40+
# ...
41+
sites:
42+
- map: symfony-demo.dev
43+
to: /home/vagrant/projects/symfony_demo/web
44+
type: symfony
45+
46+
The ``type`` option tells Homestead to use the Symfony nginx configuration.
47+
48+
At last, edit the hosts file on your local machine to map ``symfony-demo.dev``
49+
to ``192.168.10.10`` (which is the IP used by Homestead)::
50+
51+
# /etc/hosts (unix) or C:\Windows\System32\drivers\etc\hosts (Windows)
52+
192.168.10.10 symfony-demo.dev
53+
54+
Now, navigate to ``http://symfony-demo.dev`` in your web browser and enjoy
55+
developing your Symfony application!
56+
57+
.. seealso::
58+
59+
To learn more features of Homestead, including Blackfire Profiler
60+
integration, automatic creation of MySQL databases and more, read the
61+
`Daily Usage`_ section of the Homestead documentation.
62+
63+
.. _Homestead: http://laravel.com/docs/homestead
64+
.. _Vagrant: https://www.vagrantup.com/
65+
.. _the Homestead documentation: http://laravel.com/docs/homestead#installation-and-setup
66+
.. _Daily Usage: http://laravel.com/docs/5.1/homestead#daily-usage

cookbook/workflow/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ Workflow
66

77
new_project_git
88
new_project_svn
9+
homestead

0 commit comments

Comments
 (0)