Although Symfony2 has been release, but still want to start from the 1.14.x version of learning.
Official homepage: http://www.symfony-project.org/
Download Address: http://www.symfony-project.org/installation/1_4
Confirm PHP Environment, use Apache server.
First you need to generate the file directory structure from command-line code.
The steps are as follows:
1. Create a new project folder under the specified path, such as Sfproject.
2. Create a new directory under the Engineering folder (Sfproject) lib\vendor\
3. Download and extract Symfony, symfony-1.4.xx.zip. Change the name Symfony and move to Lib\vendor\.
4. Generate engineering files using command line
PHP lib\vendor\symfony\data\bin\symfony generate:project Project_Name
The main catalogue is as follows:
Directory |
Description |
apps/ |
Hosts All Project Applications |
cache/ |
The files cached by the framework |
config/ |
The project configuration files |
data/ |
Data files like initial fixtures |
lib/ |
The Project libraries and classes |
log/ |
The Framework log files |
plugins/ |
The installed plugins |
test/ |
The Unit and functional test files |
web/ |
The Web root directory (below) |
5. Generate Web front-end files using the command line
PHP lib\vendor\symfony\data\bin\symfony Generate:app frontend
6. Modify the database configuration information in the Config\databases.yml file.
You can also use the command line: $ php symfony configure:database "mysql:host=localhost;dbname=dbname" root MySecret
7. Web Server Configuration Modification Example:
# Be sure to only have this line once in your configuration Namevirtualhost 127.0.0.1:8080 # This is the Configura
tion for your project
Listen 127.0.0.1:8080
<virtualhost 127.0.0.1:8080> documentroot
"/home/ Sfproject/web "
directoryindex index.php
<directory"/home/sfproject/web ">
allowoverride All
Allow from all
</Directory>
alias/sf/home/sfproject/lib/vendor/symfony/data/web/sf
<directory "/HOME/SFPROJECT/LIB/VENDOR/SYMFONY/DATA/WEB/SF" >
allowoverride all
Allow to all
</Directory>
</VirtualHost>