Skip to main content

Installing Yii and creating Your fisrt Yii application


  • Prior to installing Yii, you must configure your application development environment as a web server capable of supporting PHP 5.1.0 or higher.



  • The basic Yii installation is almost trivial. There are really only two necessary steps:

            1. Download the Yii Framework from http://www.yiiframework.com/download/.
            2. Unpack the downloaded file to a web-accessible folder.

  • Verify that your server satisfies all of the requirements for using Yii and to ensure the installation was a success Yii comes with a simple requirement checking tool. 
  • To invoke the tool and have it verify the requirements for your installation, simply point your browser to: http://yourhostname/path/to/yii/requirements/index.php . You should see a screen similar to the one below 
  • Installing a database.

Though you can use any database that is supported by PHP with Yii, if you want to use some of built-in database abstraction layers and tools within Yii, you will need to use one that is supported by the framework. As of version 1.1, those are:
• MySQL 4.1 or later
• PostgresSQL 7.3 or later
• SQLite 2 and 3
• Microsoft SQL Server 2000 or later
• Oracle
  • Creating a new application



From your command line, change current directory to your framework folder and execute
the following:



yiic webapp WebRoot/your_app_name
 or other variations of the yiic command depending on your operating system e.g  '.\yiic' .
 the message below will appear:
Create a Web application under '/Webroot/your_app_name'? [Yes|No]
type :
yes

  • You are done! Without writing a single line of code, we can test drive our first Yii application by accessing the following URL in a Web browser:
    http://hostname/your_app_name/index.php

Comments

Popular posts from this blog

Ten output devices, advantages and disadvantages, inter-site back-up mechanism, Expert systems for medical diagnosis,information systems security

(i)Printer Printer enables us to produce information output on paper. It is one of the most popular computer output devices we often use to get information on paper - called hard copy. Advantage They produce high quality paper output for presentation at a speedy rate. It is also possible to share the printer among different users in a network. Disadvantage The cost for maintenance of the printer equipment as well printing ink is cumulatively high. (ii) Plotters These devices are used to produce graphical outputs on paper. They have automated pens that make line drawings on paper Advantage They can produce neat drawings on a piece of paper based on user commands. In Computer Aided Design (CAD) they are used to produce paper prototypes that aid in design of the final system. Disadvantage They are more expensive than printers. Further, the command based interface is difficult to use. (iii)Monitor It is...

Start Wamp server on windows automatically permanently

For those that have completely refused to use linux platforms for development, you might find this useful. As with all (aspiring) web developers, it’s always important to test your projects locally before putting it out there for the entire web community to see. One must-have developer tool for this purpose is WAMPServer. We’ve all wished it’s automatically up and running when we need it. These easy steps will help you automate WAMPServer to run on system start-up. For those unfamiliar with WAMPServer, it is a development package that lets you run web development projects locally. WAMP stands for Windows, Apache, MySQL, PHP/Perl/Python. It’s basically four programs packaged to work as one. WAMP basically turns any Windows PC into a localized web server. The Linux counterpart is called LAMP, obviously. Once WAMPServer is installed in your PC, you’ll be able to test your web projects before putting it into the live environment. But I always found it a hassle to manually s...

MYSQLi PHP Basics without prepared statements

MySQLi and PDO are object oriented and support Prepared Statements (also support Transactions, Stored Procedures and more). Prepared Statements are very important for web application security, as they protect from SQL injection. Using Prepared Statements you do not have to escape strings before insert them in Database. Moreover, PDO offers support for many databases (not only MySQL). Establish a database connection $DBServer = 'localhost';  // or an IP address $DBUser   = 'root'; $DBPass   = 'your password'; $DBName   = 'dbname';  $conn = new mysqli($DBServer, $DBUser, $DBPass, $DBName); // check connection if ($conn->connect_error) { trigger_error('Database connection failed: '  . $conn->connect_error, E_USER_ERROR); } //select rows $sql='SELECT * FROM users'; $rs=$conn->query($sql);   $rows_returned = $rs->num_rows; echo $rows_returned;  //returns number of rows //loop throu...