New colleagues first contact with the Symfony framework project, do not know symfony the entire use of the process, the following details (this article in CentOS demo, Windows the same):
Default condition:
This article by default you already have a perfect configuration of Apache + PHP + MySQL running environment.
1. Required installation software: git, composer
Download and install yourself to git and composer website.
2.git Clone Project
To the root directory of the Web server by using HTTPS or SSH connection to the GIT remote repository, such as:
[Sun@webserver html]$ git clone https://git.oschina.net/mmc-zm/xxx.git
3. Configure Symfony
Some configurations of the online items will be ignored and not entered into the remote warehouse, so they need to be installed and configured locally after entering the project directory.
[Sun@webserver html]$ cd XXX
[Sun@webserver xxx]$ Composer Install
Next composer Downloads Some of the configuration files and the required modules for the project, and then the command line prompts the configuration:
Some parameters are missing. Please provide them.
Database_driver (pdo_mysql): #数据库连接驱动, Direct enter default
Database_host (127.0.0.1): localhost #数据库连接主机地址
Database_port (NULL): 3306 #数据库端口
database_name (symfony): Symfony #数据库名
Database_user (Root): root #登录数据库的用户名
Database_password (NULL): Root #登录数据库的密码
Mailer_transport (SMTP): #邮件服务. All of the following enter default
Mailer_host (127.0.0.1):
Mailer_user (NULL):
Mailer_password (NULL):
Locale (en):
Secret (Thistokenisnotsosecretchangeit):
You can also modify the configuration in the App/config/parameters.yml file.
4. Build the Database
After configuring the Symfony, if the project uses Entity mapping table, you need to execute the console command to build the database, another: The Linux environment needs to give App/cache and App/logs 777 permissions, otherwise it will be an error. (The most complete console instruction in history: Symfony2 Console commands The most detailed description of "original")
[Sun@webserver xxx]$ php app/console-s
Symfony > Doctrine:database:create #生成数据库
Symfony > Doctrine:schema:update--dump-sql #预览sql语句
Symfony > Doctrine:schema:update--force #生成表结构, perform this instruction to update the table structure of the database whenever a change is made entity
So far, the Symfony framework project from the GIT Remote Repository clone is available for basic configuration completion.