YII2 framework from scratch (I) install Yii2 framework through Composer, yii2composer_PHP tutorial

Source: Internet
Author: User
Learn YII2 framework from scratch (1) install Yii2 framework and yii2composer through Composer. Learning YII2 framework from scratch (1) installing the Yii2 framework through Composer. yii2composer is learning PHP recently and starts to learn a quick start framework. YII2 framework (1) install Yii2 framework and yii2composer through Composer

Recently, I am studying PHP and I am looking for a quick-start framework to learn. ThinkPHP was recommended by the lecturer when watching the video of brothers. So I chose ThinkPHP to try it. it is difficult to get started with this framework and can quickly develop an application. Suitable for small-sized enterprise applications. Because it is developed by Chinese people, Chinese support is better. There are comprehensive documents, and the official website community is also active. Because all projects I use Oracle databases, I want to find a PHP framework that supports Oracle better, but the ThinkPHP framework does not support Oracle very well. So I changed the Yii Framework to try Oracle support.

The current stable version of the Yii Framework is 1.1.14. Currently, version 2.0 is a test version. It took several days to learn how to create an application in yii1. There are not many documents about Yii. Most of them are in the original English version. However, Oracle is supported. AR technology is used. I recently read the Yii2 documentation. It includes the PHP namespace concept, Bootstrap, smarty, and many other useful functions. I made great progress than Yii1. Finally, I decided to study the Yii2 framework. Yii2 should be better based on its understanding of Yii1.

Today, I finally figured out how to install Yii2. For me, this is really a huge deal. The following describes how to install Composer and how to use Composer to install yii2.

Composer is a tool used in PHP to manage dependencies. You can declare the dependent external library (libraries) in your project. Composer will help you install these dependent library files.

Install Composer in Windows:
1. download Composer

Download: https://getcomposer.org/download/

2. enable openssl support for PHP

Modify D: \ WAMP \ bin \ php \ php5.4.12 configuration file php. ini

Remove comments;


3. install Composer

The installation of "next" is complete.

After the installation is complete, you will be prompted to re-open the CMD command line.

Install the Yii2-advanced template
1. download the yii2-advanced template

Download: http://www.yiiframework.com/download/

Decompress the package
D: \ WAMP \ www

II. installation through composer

Open CMD and jump to the Directory
D: \ WAMP \ www \ advanced

We will generate an app named "yii2test.

Enter the following command:

Composer create-project -- prefer-dist -- stability = dev yiisoft/yii2-app-advanced ../yii2test

Wait... ... The following interface is displayed, indicating that the installation is successful.

3. initialize the project

Run the CMD command init.

Test installation result

Enter http: // localhost/yii2test/frontend/web/index. php in the address bar.

The following page is displayed:


Now that Yii2 is installed, I will follow up on the learning progress of PHP framework yii2.


Yii2 encountered the following error when using composer for installation ,......

You have not enabled mongodb extension in php ~~~~ It's okay with Composer.

Open your php. ini and enable mongodb extension (remove the previous)

Restart your server (apache, iis ...)

Try again.

I don't know if it's linux. search for it.


Compile (1) install the Yii2 framework through Composer. yii2composer is learning PHP recently and starts to learn a quick start framework. When I first watched a video of a brother connection...

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.