I am learning PHP recently and am looking for a framework to learn that can be used quickly. When I first watched the Band of Brothers video, the instructor recommended ThinkPHP. So I chose ThinkPHP to try. This framework is not difficult to get started and can quickly develop an application. Suitable for small business applications. Because it was developed by Chinese people, Chinese support is better. There are relatively comprehensive documents, and the official website community is also relatively active. Because the projects I work with all use Oracle databases, I want to find a PHP framework that has better Oracle support, but the ThinkPHP framework's support for Oracle is really not good. So I changed to the Yii framework to try out its support for Oracle.
The current stable version of Yii framework is 1.1.14. Currently 2.0 is a beta version. I spent a few days learning Yii1 to create applications. There is not a lot of documentation about Yii. Most of them are original in English. But the support for Oracle is okay. AR technology is used. I recently read the documentation of Yii2. It incorporates PHP's namespace concept and many useful features such as Bootstrap and smarty. It was a great improvement over Yii1, and finally I decided to learn the Yii2 framework. Based on the understanding of Yii1, Yii2 should be even better.
Today I finally figured out how to install Yii2. It’s really hard work for a novice like me. Next, we will introduce how to install Composer and how to use Composer to install Yii2.
Composer is a tool used in PHP to manage dependency relationships. You can declare the external libraries (libraries) you depend on in your project, and Composer will install these dependent library files for you.
Windows installation of Composer:
1. Download Composer
Official website download: https://getcomposer.org/download/
2. Enable openssl support for PHP
Modify D:WAMPbinphpphp5.4.12 configuration file php.ini
Remove the comment;
3. Install Composer
The "next" installation is complete.
After the installation is complete, you will be prompted to reopen the CMD command line.
Install Yii2 - advanced template
1. Download yii2 - advanced template
Official website download: http://www.yiiframework.com/download/
After downloading, unzip to
D:WAMPwww
2. Install through composer
Open CMD and jump to the directory
D:WAMPwwwadvanced
Let’s generate an app named “yii2test”.
Enter command:
composer create-project --prefer-dist --stability=dev yiisoft/yii2-app-advanced ../yii2test
Wait... ...the following interface appears, indicating that the installation is successful.
3. Initialization project
Execute CMD command init
Test installation results
Enter in the address bar: http://localhost/yii2test/frontend/web/index.php
You will see the following interface:
The installation of Yii2 is now complete. I will follow up on the learning progress of the PHP framework Yii2 later.
Your php does not enable the mongodb extension~~~~It has nothing to do with Composer
Open your php.ini and enable the mongodb extension (remove the ";" sign in front)
Restart you server (apache, iis...)
Then try again
If it is a Linux system, I don’t know, you can search it