How to install yii2.0 basic and advanced application using composer and archived files

Currently, there are two Yii 2.0 application templates available:
- Basic Application Template – a basic frontend application template.
- Advanced Application Template – consisting of a frontend, a backend, console resources, common (shared code), and support for environments.
Before Installation:
- Make sure you are using php version > php 5.4, if not upgrade it.
- To enable or recompile php with openssl, Find line
;extension=php_openssl.dll
inC:\wamp\bin\php\php.version\php.ini
and uncomment it by removing the semicolon (;
) from the beginning of the line.
Note: WAMP uses different php.ini files in the CLI and for Apache. when you enable php openssl through the WAMP UI, you enable it for Apache, not for the CLI. You need to modify C:\wamp\bin\php\php.version\php.ini
to enable it for the CLI otherwise, it shows error “openssl extension is missing” while installing composer.
Installing Composer
Download and run https://getcomposer.org/Composer-Setup.exe
OR
on Linux or Mac, run the following commands:
curl -s http://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer
To check the composer installation, Type the below code in command prompt
composer
Installing Yii2.0 Basic Application Template via composer
To install basic application template, make sure your command prompt directory pointing to web accessible folder c:/wamp/www and type the following command in command prompt.
c:\wamp\www> composer create-project --prefer-dist --stability=dev yiisoft/yii2-app-basic yii2-basic
OR
c:\> composer create-project --prefer-dist --stability=dev yiisoft/yii2-app-basic c:/wamp/www/yii2-basic
Folder Structure Of Basic Application Template
After installation of yii2.0 basic application template, you will get the folder structure like this.
Access your basic application template via http://localhost/yii2-basic/web
Installing Yii2.0 Advanced Application Template via composer
To create advanced application template, make sure your command prompt directory pointing to web accessible folder c:/wamp/www
and type the following command in command prompt.
c:\>composer create-project --prefer-dist --stability=dev yiisoft/yii2-app-advanced c:/wamp/www/yii2advanced
OR
c:\wamp\www> composer create-project --prefer-dist --stability=dev yiisoft/yii2-app-advanced yii2advanced
Folder Structure Of Advanced Application Template
After installation of yii2.0 advanced application template, you will get the folder structure like this.
Installing Yii2.0 from an Archive File
- Download the archive file from yiiframework.com
- Unpack the downloaded file to a Web accessible folder.
Getting Started
- After installation of application, you have to follow these steps to initialize the installed application. You only need to do these once for all.
type the following code in your command prompt to inititalise
phpc:/wamp/www/yii2advanced/init
- Create a new database and adjust the
components.db
configuration inC:/wamp/www/yii2advanced/common/config/main-local.php
accordingly. - Apply migrations with console command
c:\wamp\www\yii2advanced> yii migrate
- Set document roots of your Web server:
for frontend/path/to/yii-application/frontend/web/
[ In my casehttp://localhost/yii2advanced/frontend/web/index.php"
for backend/path/to/yii-application/backend/web/
[ In my casehttp://localhost/yii2advanced/backend/web/
]
Yii2.0 Advanced Application Frontend Template
Yii2.0 Advanced Application Backend Template
Very nice article, exactly what I needed.
Also visit my web page :: best male enhancement
thanks for your article really useful and really help me.thanks again
Good luck!
Hi,
I tried to install advanced version, but got installation error.
See the error: http://postimg.org/image/fb4nayezf/
Please helop
I am reading your blog and an excellent method to promote your content came to my mind.
Search in google for: Roman’s Tips – SM Traffic
So I created a secondary blog off my first one, but I now want my secondary blog to be my personal or my main blog. So that as soon and I sign on the newer blog I made would be my default blog. If that makes any sense… Is there a way to do this?.
I have learn some just right stuff here. Definitely worth bookmarking for revisiting.
I wonder how a lot effort you place to make any such magnificent informative web site.
I conceive this web site holds some real great information for everyone :D. “As ill-luck would have it.” by Miguel de Cervantes.
Howdy very nice site!! Guy .. Beautiful .. Superb .. I will bookmark your web site and take the feeds additionally…I am happy to search out a lot of useful info here within the put up, we’d like work out more techniques in this regard, thanks for sharing.
Thank you!
Your blog can go viral, you need some initial traffic only.
But how to get initial traffic??? Search in google for: Mamjo’s viral tool
thank you, sir….
i start my yii2 project sucessfully
Congrats!
My family always say that I am killing my time here at net, however I know I am getting experience everyday by reading these nice content.
I spent many futile hours trying to install yii. This site helped me out. Thanks