Skip to content

Commit b69a5cd

Browse files
committed
Updated installation instructions to use the new Symfony Installer
1 parent 4f0051d commit b69a5cd

File tree

1 file changed

+31
-87
lines changed

1 file changed

+31
-87
lines changed

best_practices/creating-the-project.rst

Lines changed: 31 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,42 @@
11
Creating the Project
22
====================
33

4-
Installing Symfony
5-
------------------
4+
Symfony Installer
5+
-----------------
66

7-
There is only one recommended way to install Symfony:
7+
In the past, Symfony projects were created with `Composer`_, the dependency manager
8+
for PHP applications. However, the current recommendation is to use the **Symfony
9+
Installer**, which has to be installed before creating your first project.
810

9-
.. best-practice::
10-
11-
Always use `Composer`_ to install Symfony.
12-
13-
Composer is the dependency manager used by modern PHP applications. Adding or
14-
removing requirements for your project and updating the third-party libraries
15-
used by your code is a breeze thanks to Composer.
16-
17-
Dependency Management with Composer
18-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11+
Linux and Mac OS X systems
12+
~~~~~~~~~~~~~~~~~~~~~~~~~~
1913

20-
Before installing Symfony, you need to make sure that you have Composer installed
21-
globally. Open your terminal (also called *command console*) and run the following
22-
command:
14+
Open your command console and execute the following:
2315

2416
.. code-block:: bash
2517
26-
$ composer --version
27-
Composer version 1e27ff5e22df81e3cd0cd36e5fdd4a3c5a031f4a 2014-08-11 15:46:48
18+
$ curl -LsS http://symfony.com/installer > symfony.phar
19+
$ sudo mv symfony.phar /usr/local/bin/symfony
20+
$ chmod a+x /usr/local/bin/symfony
2821
29-
You'll probably see a different version identifier. Never mind because Composer
30-
is updated on a continuous basis and its specific version doesn't matter.
22+
Now you can execute the Symfony Installer as a global system command called
23+
``symfony``.
3124

32-
Installing Composer Globally
33-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
25+
Windows systems
26+
~~~~~~~~~~~~~~~
3427

35-
In case you don't have Composer installed globally, execute the following two
36-
commands if you use Linux or Mac OS X (the second command will ask for your
37-
user password):
28+
Open your command console and execute the following:
3829

3930
.. code-block:: bash
4031
41-
$ curl -sS https://getcomposer.org/installer | php
42-
$ sudo mv composer.phar /usr/local/bin/composer
32+
c:\> php -r "readfile('http://symfony.com/installer');" > symfony.phar
4333
44-
.. note::
34+
Then, move the downloaded ``symfony.phar`` file to your projects directory and
35+
execute it as follows:
4536

46-
Depending on your Linux distribution, you may need to execute ``su`` command
47-
instead of ``sudo``.
37+
.. code-block:: bash
4838
49-
If you use a Windows system, download the executable installer from the
50-
`Composer download page`_ and follow the steps to install it.
39+
c:\> php symfony.phar
5140
5241
Creating the Blog Application
5342
-----------------------------
@@ -58,64 +47,19 @@ to create files and execute the following commands:
5847

5948
.. code-block:: bash
6049
50+
# Linux, Mac OS X
6151
$ cd projects/
62-
$ composer create-project symfony/framework-standard-edition blog/
63-
64-
This command will create a new directory called ``blog`` that will contain
65-
a fresh new project based on the most recent stable Symfony version available.
66-
67-
Checking the Symfony Installation
68-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
69-
70-
Once the installation is finished, enter the ``blog/`` directory and check that
71-
Symfony is correctly installed by executing the following command:
72-
73-
.. code-block:: bash
74-
75-
$ cd blog/
76-
$ php app/console --version
77-
78-
Symfony version 2.6.* - app/dev/debug
79-
80-
If you see the installed Symfony version, everything worked as expected. If not,
81-
you can execute the following *script* to check what does prevent your system
82-
from correctly executing Symfony applications:
83-
84-
.. code-block:: bash
85-
86-
$ php app/check.php
87-
88-
Depending on your system, you can see up to two different lists when executing the
89-
`check.php` script. The first one shows the mandatory requirements which your
90-
system must meet to execute Symfony applications. The second list shows the
91-
optional requirements suggested for an optimal execution of Symfony applications:
92-
93-
.. code-block:: bash
94-
95-
Symfony2 Requirements Checker
96-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
97-
98-
> PHP is using the following php.ini file:
99-
/usr/local/zend/etc/php.ini
100-
101-
> Checking Symfony requirements:
102-
.....E.........................W.....
103-
104-
[ERROR]
105-
Your system is not ready to run Symfony2 projects
106-
107-
Fix the following mandatory requirements
108-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
109-
110-
* date.timezone setting must be set
111-
> Set the "date.timezone" setting in php.ini* (like Europe/Paris).
112-
113-
Optional recommendations to improve your setup
114-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
52+
$ symfony new blog
11553
116-
* short_open_tag should be disabled in php.ini
117-
> Set short_open_tag to off in php.ini*.
54+
# Windows
55+
c:\> cd projects/
56+
c:\projects\> php symfony.phar new blog
11857
58+
This command creates a new directory called ``blog`` that contains a fresh new
59+
project based on the most recent stable Symfony version available. In addition,
60+
the installer checks if your system meets the technical requirements to execute
61+
Symfony applications. If not, you'll see the list of changes needed to meet those
62+
requirements.
11963

12064
.. tip::
12165

0 commit comments

Comments
 (0)