Join WhatsApp ChannelJoin Now

How to install yii

This post was last updated on March 20th, 2021 at 04:02 am

In this article , i we will show you how to Install Yiiframework With XAMPP On Window Use Composer step by step. via Composer it is simple and easy to install latest Yii 2.0 version by running a single command. Minimum PHP version that we need to install is PHP 5.4 or greater.

Install Composer

Watch link composer

Install Yii

Open Your cmd and set htdocs directory on your XAMPP server to Install Yii

C:\xampp\htdocs

Yiiframework

Now Run the following command to install Yii

composer create-project --prefer-dist yiisoft/yii2-app-basic yiiproject

installation is complete, use localhost to open your project in browser.

The Path for the same is http://localhost/yiiproject/web/.

Install CakePHP 4

Configuring the Host File in Windows

If you wish to customise the native browser addresses for your website. To do this, we’d like to put together a Virtual Host in XAMPP for a Yii project and during this example we would like to put together the domain localhost.yiiproject.com for our project. To do so, edit httpd-vhosts.conf file that is found among C:\xampp\apache\conf\extra\httpd-vhosts.conf

# VirtualHost for localhost.yiiproject.com
  
<VirtualHost *:80>
    DocumentRoot "C:/xampp/htdocs/yiiproject/web"
    ServerName localhost.yiiproject.com  
    <Directory "C:/xampp/htdocs/yiiproject/">
      Options Indexes MultiViews FollowSymLinks
      AllowOverride All
      Require all granted
    </Directory>
</VirtualHost>

After this, apache server is taking note of localhost.yiiproject.com connections, however we’ve got to piece our hosts file that enables to send localhost.yiiproject.com to the localhost , to do so, edit the hosts file that is found inside C:\Windows\System32\drivers\etc

Add follow code snippet at the end of your file:

127.0.0.1 localhost
127.0.0.1 127.0.0.1
127.0.0.1 localhost.yiiproject.com

After set up Host in XAMPP, restart Apache server using the XAMPP control panel, use this URL localhost.yiiproject.com in your browser.

Please be at liberty to comment below, problems if you face – we are here to solve your problems.

Recommended Posts