国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

Home Backend Development PHP Tutorial Detailed tutorial on symfony installation

Detailed tutorial on symfony installation

Aug 09, 2017 pm 02:20 PM
symfony Install Tutorial

To learn symfony, you must first learn how to install symfony. This article talks about how to install the symfony framework under Windows. The installation under Linux is similar.

1. First download symfony from this address: http://symfony.coDetailed tutorial on symfony installationm/legacy, this series of tutorials uses version 1.2 of symfony.

2. Create a project directory under the root directory of your website, such as bolg, then create a lib directory in this directory, create a vendor directory under the lib directory, and unzip the downloaded symfony compressed package. Go to the vendor directory.

3. Open the command line tool, enter the blog directory, enter the following command to create a symfony project

php lib\vendor\symfony\data\bin\symfony generate-project blog

This command creates the following directory structure:


The description of each directory is as follows:

DirectoryDescription
apps/Store all applications of the project
cache/The cache file of the framework
config/Project configuration file
lib/Classes and libraries used in the project
log/Project log file
plugins/Installed plug-ins
test/Unit test and functional test files
web/Website root directory (see below)
4、目前這個項目還沒法使用,因為我們至少需要創(chuàng)建一個應(yīng)用程序,在當(dāng)前目錄在創(chuàng)建一個前臺(frontend)應(yīng)用程序
php symfony init-app frontend
這個命令在apps目錄下生成了如下目錄:


另外還在web目錄下生成了如下文件:index.php和frontend_dev.php


其中index.php是生產(chǎn)環(huán)境的入口文件,frontend_dev.php是測試的入口文件,通過frontend_dev.php訪問程序,會在頁面上展示一個調(diào)試欄,方便我們調(diào)試程序。至于為什么index.php不叫frontend.php,那是因為symfony在創(chuàng)建第一個應(yīng)用程序的時候默認(rèn)使用index.php作為生產(chǎn)環(huán)境入口文件。

5、設(shè)置虛擬主機

如果你使用的是apache作為服務(wù)器,將如下代碼加入到apache的配置文件,再重啟apache即可。

Listen 127.0.0.1:8080

<VirtualHost 127.0.0.1:8080>
  DocumentRoot "H:/wamp/www/blog/web"
  DirectoryIndex index.php
  <Directory "H:/wamp/www/blog/web">
    AllowOverride All
    Allow from All
  </Directory>

  Alias /sf H:/wamp/www/symfony/data/web/sf
  <Directory "H:/wamp/www/symfony/data/web/sf">
    AllowOverride All
    Allow from All
  </Directory>
</VirtualHost>


注:如上寫法只針對windows。注意將以上目錄轉(zhuǎn)換成你的開發(fā)環(huán)境的對應(yīng)目錄。

現(xiàn)在打開瀏覽器,訪問http://localhost:8080,可以看到如下頁面:


訪問http://localhost:8080/frontend_dev.php:



有一些報錯信息,是由于php版本原因的報錯,暫時不作處理。可以看到測試控制器的右上角多了個調(diào)試框。

今天就講到這里,下一篇將結(jié)束symfony的頁面創(chuàng)建知識。

The above is the detailed content of Detailed tutorial on symfony installation. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undress AI Tool

Undress AI Tool

Undress images for free

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

In summer, you must try shooting a rainbow In summer, you must try shooting a rainbow Jul 21, 2024 pm 05:16 PM

After rain in summer, you can often see a beautiful and magical special weather scene - rainbow. This is also a rare scene that can be encountered in photography, and it is very photogenic. There are several conditions for a rainbow to appear: first, there are enough water droplets in the air, and second, the sun shines at a low angle. Therefore, it is easiest to see a rainbow in the afternoon after the rain has cleared up. However, the formation of a rainbow is greatly affected by weather, light and other conditions, so it generally only lasts for a short period of time, and the best viewing and shooting time is even shorter. So when you encounter a rainbow, how can you properly record it and photograph it with quality? 1. Look for rainbows. In addition to the conditions mentioned above, rainbows usually appear in the direction of sunlight, that is, if the sun shines from west to east, rainbows are more likely to appear in the east.

Detailed steps to install Go language on Win7 computer Detailed steps to install Go language on Win7 computer Mar 27, 2024 pm 02:00 PM

Detailed steps to install Go language on Win7 computer Go (also known as Golang) is an open source programming language developed by Google. It is simple, efficient and has excellent concurrency performance. It is suitable for the development of cloud services, network applications and back-end systems. . Installing the Go language on a Win7 computer allows you to quickly get started with the language and start writing Go programs. The following will introduce in detail the steps to install the Go language on a Win7 computer, and attach specific code examples. Step 1: Download the Go language installation package and visit the Go official website

How to install Go language under Win7 system? How to install Go language under Win7 system? Mar 27, 2024 pm 01:42 PM

Installing Go language under Win7 system is a relatively simple operation. Just follow the following steps to successfully install it. The following will introduce in detail how to install Go language under Win7 system. Step 1: Download the Go language installation package. First, open the Go language official website (https://golang.org/) and enter the download page. On the download page, select the installation package version compatible with Win7 system to download. Click the Download button and wait for the installation package to download. Step 2: Install Go language

PHP Tutorial: How to convert int type to string PHP Tutorial: How to convert int type to string Mar 27, 2024 pm 06:03 PM

PHP Tutorial: How to Convert Int Type to String In PHP, converting integer data to string is a common operation. This tutorial will introduce how to use PHP's built-in functions to convert the int type to a string, while providing specific code examples. Use cast: In PHP, you can use cast to convert integer data into a string. This method is very simple. You only need to add (string) before the integer data to convert it into a string. Below is a simple sample code

How to download 360 Secure Browser on your computer How to download 360 Secure Browser on your computer Apr 12, 2024 pm 01:52 PM

How to download 360 Secure Browser on your computer? It is a very secure web browser software. This browser is very rich in functions and very simple to operate. Using 360 Secure Browser to browse the web can protect user privacy and security very well. Many people like to use this browser. Browser office, but many people still don’t know how to download and install 360 Secure Browser on their computers. This article will give you a detailed introduction to the installation process of the 360 ??Safe Browser PC version, hoping to help you solve the problem. Overview of the installation process under the computer version of 360 Secure Browser 1. On the computer’s main page, find “360 Software Manager” and enter (as shown in the picture). 2. Open 360 Software Manager and find the search box (as shown in the picture). 3. Click Search

A simple tutorial on converting full-width English letters to half-width letters A simple tutorial on converting full-width English letters to half-width letters Mar 25, 2024 pm 09:21 PM

When using a computer to input English, sometimes we encounter the difference between full-width English letters and half-width English letters. Full-width English letters refer to the characters input by pressing the Shift key and the English letter key combination when the input method is Chinese mode. They occupy a full-width character width. Half-width English letters refer to characters input directly when the input method is English mode, and they occupy half a character width. In some cases, we may need to convert full-width English letters to half-width letters. Here is a simple tutorial: First, open a text editor or any

Tutorial on how to turn off the payment sound on WeChat Tutorial on how to turn off the payment sound on WeChat Mar 26, 2024 am 08:30 AM

1. First open WeChat. 2. Click [+] in the upper right corner. 3. Click the QR code to collect payment. 4. Click the three small dots in the upper right corner. 5. Click to close the voice reminder for payment arrival.

How to open Python after downloading How to open Python after downloading Apr 03, 2024 pm 05:12 PM

To open the Python you just downloaded, follow these steps: Place the installer in an easily accessible location. Double-click the installer icon and follow the on-screen instructions. Once the installation is complete, enter "python" in a command prompt or terminal window to start a Python interactive shell.

See all articles