@@ -10,9 +10,9 @@ the most common issues that may appear during the installation process.
1010Creating Symfony Applications
1111-----------------------------
1212
13- Symfony provides a dedicated application called **Symfony Installer ** to ease
13+ Symfony provides a dedicated application calledthe **Symfony Installer ** to ease
1414the creation of Symfony applications. This installer is a PHP 5.4 compatible
15- application thathas to be installedin your system only once:
15+ executable thatneeds to be installedon your system only once:
1616
1717..code-block ::bash
1818
@@ -26,7 +26,7 @@ application that has to be installed in your system only once:
2626 ..note ::
2727
2828 In Linux and macOS, a global ``symfony `` command is created. In Windows,
29- move the ``symfony `` file tosome directory included in the ``PATH ``
29+ move the ``symfony `` file toa directory that's included in the ``PATH ``
3030 environment variable to create the global command or move it to any other
3131 directory convenient for you:
3232
@@ -126,7 +126,7 @@ Running the Symfony Application
126126
127127Symfony leverages the internal PHP web server (available since PHP 5.4) to run
128128applications while developing them. Therefore, running a Symfony application is
129- a matter of browsing the project directory and executing this command:
129+ a matter of browsingto the project directory and executing this command:
130130
131131..code-block ::bash
132132
@@ -142,8 +142,7 @@ Welcome Page of Symfony:
142142
143143If you see a blank page or an error page instead of the Welcome Page, there is
144144a directory permission misconfiguration. The solution to this problem is
145- explained in the:ref: `Setting up Permissions <book-installation-permissions >`
146- section.
145+ explained in the:doc: `/setup/file_permissions `.
147146
148147When you are finished working on your Symfony application, stop the server by
149148pressing ``Ctrl+C `` from the terminal or command console.
@@ -169,95 +168,20 @@ before moving on:
169168
170169 .. _book-installation-permissions :
171170
172- Setting up Permissions
173- ----------------------
171+ Fixing Permissions Problems
172+ ---------------------------
174173
175- One important Symfony requirement is that the ``app/cache `` and ``app/logs ``
176- directories must be writable both by the web server and the command line user.
177-
178- On Linux and macOS systems, if your web server user is different from your
179- command line user, you need to configure permissions properly to avoid issues.
180- There are several ways to achieve that:
181-
182- 1. Use the same user for the CLI and the web server
183- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
184-
185- Edit your web server configuration (commonly ``httpd.conf `` or ``apache2.conf ``
186- for Apache) and set its user to be the same as your CLI user (e.g. for Apache,
187- update the ``User `` and ``Group `` directives).
188-
189- ..caution ::
190-
191- If this solution is used in a production server, be sure this user only has
192- limited privileges (no access to private data or servers, execution of
193- unsafe binaries, etc.) as a compromised server would give to the hacker
194- those privileges.
195-
196- 2. Using ACL on a system that supports ``chmod +a `` (macOS)
197- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
198-
199- On macOS systems, the ``chmod `` command supports the ``+a `` flag to define an
200- ACL. Use the following script to determine your web server user and grant the
201- needed permissions:
202-
203- ..code-block ::bash
204-
205- $ rm -rf app/cache/*
206- $ rm -rf app/logs/*
207-
208- $ HTTPDUSER=` ps axo user,comm| grep -E' [a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root| head -1| cut -d\ -f1`
209- $ sudo chmod +a" $HTTPDUSER allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs
210- $ sudo chmod +a" ` whoami` allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs
211-
212- 3. Using ACL on a system that supports ``setfacl `` (Linux/BSD)
213- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
214-
215- Most Linux and BSD distributions don't support ``chmod +a ``, but do support
216- another utility called ``setfacl ``. You may need to install ``setfacl `` and
217- `enable ACL support `_ on your disk partition before using it. Then, use the
218- following script to determine your web server user and grant the needed permissions:
219-
220- ..code-block ::bash
221-
222- $ HTTPDUSER=` ps axo user,comm| grep -E' [a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root| head -1| cut -d\ -f1`
223- # if this doesn't work, try adding `-n` option
224- $ sudo setfacl -R -m u:" $HTTPDUSER " :rwX -m u:` whoami` :rwX app/cache app/logs
225- $ sudo setfacl -dR -m u:" $HTTPDUSER " :rwX -m u:` whoami` :rwX app/cache app/logs
226-
227- ..note ::
228-
229- setfacl isn't available on NFS mount points. However, storing cache and logs
230- over NFS is strongly discouraged for performance reasons.
231-
232- 4. Without using ACL
233- ~~~~~~~~~~~~~~~~~~~~
234-
235- If none of the previous methods work for you, change the umask so that the
236- cache and log directories are group-writable or world-writable (depending
237- if the web server user and the command line user are in the same group or not).
238- To achieve this, put the following line at the beginning of the ``app/console ``,
239- ``web/app.php `` and ``web/app_dev.php `` files::
240-
241- umask(0002); // This will let the permissions be 0775
242-
243- // or
244-
245- umask(0000); // This will let the permissions be 0777
246-
247- ..note ::
248-
249- Changing the umask is not thread-safe, so the ACL methods are recommended
250- when they are available.
174+ If you have any file permission errors or see a white screen, then read
175+ :doc: `/setup/file_permissions ` for more information.
251176
252177.. _installation-updating-vendors :
253178
254179Updating Symfony Applications
255180-----------------------------
256181
257- At this point, you've created a fully-functional Symfony application in which
258- you'll start to develop your own project. A Symfony application depends on
259- a number of third-party libraries stored in the ``vendor/ `` directory and
260- managed by Composer.
182+ At this point, you've created a fully-functional Symfony application! Every Symfony
183+ app depends on a number of third-party libraries stored in the ``vendor/ `` directory
184+ and managed by Composer.
261185
262186Updating those libraries frequently is a good practice to prevent bugs and
263187security vulnerabilities. Execute the ``update `` Composer command to update them
@@ -281,46 +205,30 @@ complexity of your project):
281205 A good security practice is to execute this command regularly to be able to
282206 update or replace compromised dependencies as soon as possible.
283207
284- Installing the Symfony Demo Application
285- ---------------------------------------
286-
287- The `Symfony Demo application `_ is a fully-functional application that shows the
288- recommended way to develop Symfony applications. The application has been
289- conceived as a learning tool for Symfony newcomers and its source code contains
290- tons of comments and helpful notes.
291-
292- If you have installed the Symfony Installer as explained in the above sections,
293- install the Symfony Demo application anywhere in your system executing the
294- ``demo `` command:
295-
296- ..code-block ::bash
297-
298- $ symfony demo
208+ .. _installing-a-symfony2-distribution :
299209
300- Once downloaded, enter into the ``symfony_demo/ `` directory, run the PHP's
301- built-in web server (``php app/console server:run ``) and access to the
302- ``http://localhost:8000 `` URL to start using the Symfony Demo application.
210+ Installing the Symfony Demo or Other Distributions
211+ --------------------------------------------------
303212
304- .. _installing-a-symfony2-distribution :
213+ You've already downloaded the Symfony Standard Edition: the default starting project
214+ for all Symfony apps. You'll use this project throughout the documentation to build
215+ your app!
305216
306- Installing a Symfony Distribution
307- ---------------------------------
217+ Symfony also provides some other projects and starting skeletons that you can use:
308218
309- Symfony distributions are fully-functional applications that include the Symfony
310- core libraries, a selection of useful bundles, a sensible directory structure
311- and some default configuration. In fact, when you created a Symfony application
312- in the previous sections, you actually downloaded the default distribution
313- provided by Symfony, which is called `Symfony Standard Edition `_.
219+ `The Symfony Demo Application `_
220+ This is a fully-functional application that shows the recommended way to develop
221+ Symfony applications. The app has been conceived as a learning tool for Symfony
222+ newcomers and its source code contains tons of comments and helpful notes.
314223
315- The Symfony Standard Edition is the best choice for developers starting with
316- Symfony. However, the Symfony Community has published other distributions that
317- you may use in your applications:
224+ `The Symfony CMF Standard Edition `_
225+ The `Symfony CMF `_ is a project that helps make it easier for developers to add
226+ CMS functionality to their Symfony applications. This is a starting project
227+ containing the Symfony CMF.
318228
319- * The `Symfony CMF Standard Edition `_ to get started with the `Symfony CMF `_
320- project, which is a project that makes it easier for developers to add CMS
321- functionality to Symfony applications.
322- * The `Symfony REST Edition `_ shows how to build an application that provides a
323- RESTful API using the `FOSRestBundle `_ and several other related bundles.
229+ `Symfony REST Edition `_
230+ Shows how to build an application that provides a RESTful API using the
231+ `FOSRestBundle `_ and several other related Bundles.
324232
325233.. _install-existing-app :
326234
@@ -348,6 +256,11 @@ the following when installing an existing Symfony application:
348256# now Composer will ask you for the values of any undefined parameter
349257 $ ...
350258
259+ Keep Going!
260+ -----------
261+
262+ With setup behind you, it's time to:doc: `Create your First Page in Symfony </page_creation >`.
263+
351264Learn More
352265----------
353266
@@ -361,14 +274,14 @@ Learn More
361274setup/web_server_configuration
362275setup/composer
363276setup/*
277+ install/*
364278
365279.. _`Composer` :https://getcomposer.org/
366- .. _`enable ACL support` :https://help.ubuntu.com/community/FilePermissionsACLs
367280.. _`Symfony Standard Edition` :https://github.com/symfony/symfony-standard
368281.. _`Symfony CMF Standard Edition` :https://github.com/symfony-cmf/symfony-cmf-standard
369282.. _`Symfony CMF` :http://cmf.symfony.com/
370283.. _`Symfony REST Edition` :https://github.com/gimler/symfony-rest-edition
371284.. _`FOSRestBundle` :https://github.com/FriendsOfSymfony/FOSRestBundle
372285.. _`Git` :http://git-scm.com/
373286.. _`Phar extension` :http://php.net/manual/en/intro.phar.php
374- .. _`Symfony Demo application` :https://github.com/symfony/symfony-demo
287+ .. _`The Symfony Demo application` :https://github.com/symfony/symfony-demo