Create a new project using yii framework in ubuntu

yii framework is the most popular Php  framework in the web for web 2.0 development. This article guide u to start your new php application from scratch using yii framework. Let’s download the framework from the website, always chose the Latest Release e.g  1.1.9 (Jan 1, 2012) .Extract the zip files to your localhost and rename the folder as your wish. Here i wish to rename my framework as (yiifw), thats all now checks  your server configuration meets the requirements for running Yii Web applications or not . To check the requirements open the http://localhost/yiifw/requirements/ path in your browser. if it passed all result, you are successfully setup your yii framework development environment. for detail visit .now i will saw you step by step how to create a new project.

step-1:Open your terminal and type the following code or CD to your framework folder.

 cd /var/www/yiifw

Step-2: Now tell yiic command line program to generate the Yii application files for your new project. run the following command in your terminal.

./framework/yiic webapp /home/username/public_html/yiifw

that’s all check your localhost framework folder, the yiic command line program already generate your new project skeleton in MVC  structure called newproject.Now you can check your application in your localhost trough the link: http://localhost/yiifw/newproject/

Now your new project will look like the following image.


2 thoughts on “Create a new project using yii framework in ubuntu

  1. Hi..
    If I want to create a project from scratch..say without that command..How can i do that.
    I made a directory naming myproject and added a contoller and config main file and index.php having same as testdrive project. But i am still getting this::


    Unable to resolve the request “site/error”. (/var/www/yii/framework/web/CWebApplication.php:286)

    What can be the case here??

  2. Hello Sankalp..
    Hope u doing well..command line is the best way to create a YII project.. as per your description, you are getting CHttpException error below
    Unable to resolve the request “site/error”. (/var/www/yii/framework/web/CWebApplication.php:286)
    The above error shows that YII framework is extracted in /var/www/ folder which is the cause of error.
    it is not necessary to upload whole framework to the /var/www/ can upload the only folder generate by the yiic commandline…
    follow the steps again.. in step (1) i mention that Open your terminal and type the following code or CD to your framework folder.
    cd /var/www/yiifw may confuse in that step. To avoid this error put downloaded framewirk in desktop. open the terminal go the /home/desktop/frameworkfolder/ then type ./framework/yiic webapp myproject . this command will generate a new folder named (myproject) in side your frameworkfolder, with necessary file to run a yii project. Thats all copy the (myproject) folder then upload it to your (/var/www/) folder

    you can create a YII project directly from your IDE if you are using NetBeans/Eclipse follow below links

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s