Skip to content

Commit 66f035b

Browse files
committed
feature #5655 Added doc about Homestead's Symfony integration (WouterJ)
This PR was submitted for the 2.8 branch but it was merged into the 2.3 branch instead (closes #5655). Discussion ---------- Added doc about Homestead's Symfony integration | Q | A | --- | --- | Doc fix? | no | New docs? | yes | Applies to | all | Fixed tickets | - Commits ------- d1d4275 Added doc about Homestead's Symfony integration
2 parents a088687 + d1d4275 commit 66f035b

File tree

3 files changed

+78
-0
lines changed

3 files changed

+78
-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: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
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+
.. tip::
12+
13+
Due to the amount of filesystem operations in Symfony (e.g. updating cache
14+
files and writing to log files), Symfony can slow down signifcantly. To
15+
improve the speed, consider :ref:`overriding the cache and log directories <override-cache-dir>`
16+
to a location outside the NFS share (for instance, by using
17+
:phpfunction:`sys_get_temp_dir`). You can read `this blog post`_ for more
18+
tips to speed up Symfony on Vagrant.
19+
20+
Install Vagrant and Homestead
21+
-----------------------------
22+
23+
Before you can use Homestead, you need to install and configure Vagrant and
24+
Homestead as explained in `the Homestead documentation`_.
25+
26+
Setting Up a Symfony Application
27+
--------------------------------
28+
29+
Imagine you've installed your Symfony application in
30+
``~/projects/symfony_demo`` on your local system. You first need Homestead to
31+
sync your files in this project. Execute ``homestead edit`` to edit the
32+
Homestead configuration and configure the ``~/projects`` directory:
33+
34+
.. code-block:: yaml
35+
36+
# ...
37+
folders:
38+
- map: ~/projects
39+
to: /home/vagrant/projects
40+
41+
The ``projects/`` directory on your PC is now accessible at
42+
``/home/vagrant/projects`` in the Homestead environment.
43+
44+
After you've done this, configure the Symfony application in the Homestead
45+
configuration:
46+
47+
.. code-block:: yaml
48+
49+
# ...
50+
sites:
51+
- map: symfony-demo.dev
52+
to: /home/vagrant/projects/symfony_demo/web
53+
type: symfony
54+
55+
The ``type`` option tells Homestead to use the Symfony nginx configuration.
56+
57+
At last, edit the hosts file on your local machine to map ``symfony-demo.dev``
58+
to ``192.168.10.10`` (which is the IP used by Homestead)::
59+
60+
# /etc/hosts (unix) or C:\Windows\System32\drivers\etc\hosts (Windows)
61+
192.168.10.10 symfony-demo.dev
62+
63+
Now, navigate to ``http://symfony-demo.dev`` in your web browser and enjoy
64+
developing your Symfony application!
65+
66+
.. seealso::
67+
68+
To learn more features of Homestead, including Blackfire Profiler
69+
integration, automatic creation of MySQL databases and more, read the
70+
`Daily Usage`_ section of the Homestead documentation.
71+
72+
.. _Homestead: http://laravel.com/docs/homestead
73+
.. _Vagrant: https://www.vagrantup.com/
74+
.. _the Homestead documentation: http://laravel.com/docs/homestead#installation-and-setup
75+
.. _Daily Usage: http://laravel.com/docs/5.1/homestead#daily-usage
76+
.. _this blog post: http://www.whitewashing.de/2013/08/19/speedup_symfony2_on_vagrant_boxes.html

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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy