1
1
Creating the Project
2
2
====================
3
3
4
- Installing Symfony
5
- ------------------
4
+ Symfony Installer
5
+ -----------------
6
6
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.
8
10
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
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
19
13
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:
23
15
24
16
.. code-block :: bash
25
17
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
28
21
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 `` .
31
24
32
- Installing Composer Globally
33
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
25
+ Windows systems
26
+ ~~~~~~~~~~~~~~~
34
27
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:
38
29
39
30
.. code-block :: bash
40
31
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
43
33
44
- .. note ::
34
+ Then, move the downloaded ``symfony.phar `` file to your projects directory and
35
+ execute it as follows:
45
36
46
- Depending on your Linux distribution, you may need to execute ``su `` command
47
- instead of ``sudo ``.
37
+ .. code-block :: bash
48
38
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
51
40
52
41
Creating the Blog Application
53
42
-----------------------------
@@ -58,64 +47,19 @@ to create files and execute the following commands:
58
47
59
48
.. code-block :: bash
60
49
50
+ # Linux, Mac OS X
61
51
$ 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
115
53
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:\p rojects\> php symfony.phar new blog
118
57
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.
119
63
120
64
.. tip ::
121
65
0 commit comments