[5] install thinkPHP3.1.3 in PHP Development Environment

Source: Internet
Author: User
ThinkPHP official ThinkPHP: thinkphp. cnDownThinkPHP does not need to be installed separately. Copy it to the parsing directory of the server to form the ThinkPHP directory. ThinkPHP directory structure description ThinkPHP. php: public portal file of the Framework Common: contains some public files of the Framework, system definition, System

ThinkPHP get and install ThinkPHP official: http://thinkphp1.cn/Down ThinkPHP without separate installation, copy to the server parsing directory, the formation of ThinkPHP directory can be. ThinkPHP directory structure description ThinkPHP. php: public portal file of the Framework Common: contains some public files of the Framework, system definition, System

ThinkPHP acquisition and installation

ThinkPHP official: http://thinkphp1.cn/Down
ThinkPHP does not need to be installed separately. Copy it to the server resolution directory to form the ThinkPHP directory.

ThinkPHP directory structure description
  • ThinkPHP. php: public portal file of the framework
  • Common: contains some Common files, system definitions, system functions, and Convention configurations of the framework.
  • Lang: System Language file directory
  • Lib: system base class library directory
  • Tpl: system template directory
  • Mode: Extended directory of framework Mode
  • Vendor: third-party class library directory
ThinkPHP runtime environment requirements

ThinkPHP supports Windows/Unix server environments and runs on a variety of WEB servers and modes including Apache, IIS, and nginx. PHP5.0 and later versions are required to support Mysql, MsSQL, PgSQL, Sqlite, Oracle, Ibase, PDO, and other databases and connections.

ThinkPHP has no special module requirements. The specific runtime environment requirements of the application system depend on the modules Involved in the development. ThinkPHP's underlying memory consumption is extremely low, and its file size is also lightweight, so there will be no bottlenecks in space and memory usage.

Portal File

A project (system) usually has a unified portal file. All function operations of the project are performed through this portal file, and the portal file is usually executed in the first step, this is a very important concept in ThinkPHP or PHP framework.

Create an entry file

Create a project directory, such as phpweb, under the Web directory (d:/www. Create a file index. php In the php web directory. The file content is as follows:

 

The ThinkPHP framework path, project path, and name are defined in the portal file, and the ThinkPHP. php file is loaded. A project application is instantiated.

In addition, open IndexAction. class. php In D: \ WWW \ phpweb \ Index \ Lib \ Action and you will see the public function index () method. Change the content

Echo "Hello World!
";
Echo '2017-03-09 ';

After saving the entry file, run the file in the browser:

Http: // http://www.phpweb.com/index.php

You can see the prompt that the project is successfully built in the browser:


If the page cannot be displayed, check the configuration of the portal file.

Project

The term concept in ThinkPHP is equivalent to an independent ThinkPHP framework-based application. The project has its own entry file, configuration file, application library and template, and cache log. The project is defined in the entry file, including the project name and path (in the preceding example ).

All applications in the project are accessed through the portal file. A website consists of one or more projects. The typical deployment of a website is as follows:

  • ThinkPHP: ThinkPHP core package directory
  • Home: website application project directory
  • Index. php: website entry file
  • Admin. php: admin portal File
  • ...... More project Directories
  • Third-party applications: directories such as BBS and SNS
Prompt

ThinkPHP supports project groups. project groups make project deployment more complex, but more convenient and logical. We recommend that you use project groups. For details, see ThinkPHP project group.

Project directory structure

When you run the project entry file for the first time, the system automatically generates the project directory structure under phpweb:

  • Common: The public file directory of the project. Generally, the public functions of the project are placed.
  • Conf: project configuration Directory, which stores the configuration file
  • Lang: Project Language Pack directory (optional), supported in multiple languages
  • Lib: directory of the Project class library, usually including the Action and Model subdirectories.
  • Tpl: Project template directory. Different template themes are supported.
  • Runtime: The project Runtime directory, including the Cache (template Cache), Temp (Data Cache), Data (Data directory), and Logs (Log File) subdirectories.

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.