Quantcast
Channel: Aafrin.com » Web
Viewing all articles
Browse latest Browse all 12

A Noob’s Guide To Set Yii Php Framework In Windows Environment – Part 1

$
0
0

As the title suggest, this tutorial is for people whom are new to the Yii Php Framework. I will explain on how to set up the framework in a local machine and get it running. Before moving to the tutorial, lets have short preview on what is Yii Php Framework is about?

Yii is a high-performance component-based PHP framework best for developing large-scale Web applications. Yii comes with a full stack of features, including MVC, DAO/Active Record, I18N/L10N, caching, jQuery-based AJAX support, authentication and role-based access control, scaffolding, input validation, widgets, events, theme-ing, Web services, and so on. Written in strict OOP, Yii is easy to use and is extremely flexible and extensible.

Now let’s set it up !!!

I have spilt-ed the following tutorial into two different levels. The level one covers on setting and configuring the server in local machine while the level 2 will be dealing with setting and configuring the Yii Framework  within the server. You need to complete the level 1 before moving to level 2. If you already had a server installed in your local machine. You can skip level 1 and move directly to level 2.

Level 1

We can download PHP, MYSQL, Apache separately and install it on our machine but it will be very complicated to perform the configuration. Therefore I will be using a server built in with all the necessary components. I am using Xampp Server for windows in this tutorial.

1. Visit the official site for Xampp Server and download the package from here.

2. Once the download finish, extract and place the folder on C: root. The file should be accessible via C:\xampp\xamppfiles\. Refer screenshot to below.

3.  Run the “setup_xampp.bat” that is located inside Xampp folder and begin the installation. A command line interface will pop up during the installation. Follow the instruction displayed on the interface and start the Xampp Control Panel once the setup is done.

4. At this point, you should have successfully installed the Xampp Server in your local machine. Star the Apache server from the Xampp Control Panel. Now try visiting  http://localhost/ in your favorite browser. If everything went fine, you should see a screen similar to the second screenshot below. Take Note: Please close application like Skype or any other VOIP Client, since it also be using same port as the Apache.

The server is ready and running and now we need to set the PHP path variable in the local machine. The path is set so that we can execute PHP command directly via command line. This is required for scaffolding in Yii framework. Follow the steps below to set the PHP path in your local machine.

1. Right click My Computer and choose properties. A new window will pop up similar to the below. Now choose Advanced system settings which is located on the left hand sidebar menu.

2. In the Advanced system settings window, navigate to the Advanced tab and choose the Environment Variables.

3. Click new in the environment variables window and set the variable name as “path” and variable value as the PHP folder path. In this case, it should be “C:\xampp\php” (without quotes). Put a semicolon (;) to separate the PHP path with the other existing paths, if there is any.

4. Click OK to close all the windows and reboot/restart the machine. To check, if the path are working, open a command line interface and type php -v. The version of your PHP should be displayed like below.

Done !!! The Xampp Server and the PHP path setup is completed. Next is to set the, Yii Framework within the server. I will write and post the tutorial separately as part 2. Grab the RSS feed for the updates…


Viewing all articles
Browse latest Browse all 12

Trending Articles