PHP Framework---Symfony reading notes 1____php

Source: Internet
Author: User
Tags php framework

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>


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.