Saturday, April 16, 2011

Custamizing moodle


Changing Themes in moodle : step by step procedure
 1. click on site administration
 2.click on appearance
 3. click on themes
 4. click on select themes.
(different themes will appear on the screen .. click on the particular

theme to choose your theme.


Changing moodle logo from the front page :-
 1. Go to server< moodle < pics
 2. Copy your logo image in this folder.
 3. Rename your logo with the same name as of moodle logo.


Changing " moodle docs for your page" at the buttom of the page.
  1.click on site administration
  2.click on appearance
  3.click on moodle docs
  4.clear the root  path from moodle docs documetnt.
    that link will dissappear from the butoom of the page.




Friday, April 8, 2011

installation of php in windows 7


Install PHP on Windows 7

Installing PHP on Windows 7 is quite a simple affair. However, as experienced developers know, you need to have a web server running first. I suggest using the world's most popular web server - get instructions on how to install Apache on Windows 7 operating system. And if you are a budding PHP programmer, you would very soon like to use it with MySQL database. So once you have finished with PHP installation, read the steps to install MySQL on Windows 7.
Assuming you have successfully been able to install Apache on Windows 7 and have seen the "It works" page, download the PHP file from www.php.net. Though I am on a 64 bit Windows 7 system, I downloaded php-5.2.11-Win32.zip because PHP, at the time of writing, doesn't come in 64 bit flavour.
Important note: Download the Thread Safe PHP zip file.

Create a folder to install PHP

This tutorial will describe how to install PHP from the zip archive and not from the installer file - [Slide 1]. Somehow, I've found this is a little simpler.
The first thing is to create a folder where you would like to unzip the PHP files. Since I like to keep things segregated and yet accessible, I'll be installing PHP in its own directory under the C: drive and recommend you do the same. So go ahead and create a folder called PHPon the C drive. Now unzip the contents of the downloaded PHP zip file into this folder; refer [Slide 2].
In this C:/PHP folder, you'll see a file called php.ini-recommended. Right-click on this file and choose Copy - [Slide 3]. Now paste the file in the same directory - [Slide 4]. Rename this file to php.ini. Windows will tell you that changing the extension will make it unusable; ignore the message and continue - [Slide 5].
Note: Your computer might not display the file extension in which case I suggest you read how to get the file extension on Windows 7.
You can also try your hand with DOS commands to change the file extension on Windows 7; definitely a more geeky way to get things done!
Can't find the php.ini-recommended file?
The newer PHP versions come with two files: php.ini-development and php.ini-production. The former is more suited for a developer machine such as yours, while the latter is for web servers that host 'live web sites' in which security is of paramount importance. Thus, use php.ini-development instead of php.ini-recommended.


Configuration Apache 2.2 web server for PHP installation

Though you have been able to put PHP on your computer, it's still not "installed" in the true sense of the word. We have to help the Apache web server communicate with PHP. This is done by editing the Apache configuration file, httpd.conf.
Go to All Programs -> Apache HTTP Server 2.2 -> Configure Apache Server -> Edit the Apache httpd.conf Configuration File. This opens httpd.conf file in Notepad - [Slide 6].
Gear up to make some changes to this file - check the screenshots from the slideshow as you go along.
  • Locate the "LoadModule section" (Tip: use the Find feature or the Ctrl-F key combination). Add the following line - [Slide 7]

    LoadModule php5_module "c:/PHP/php5apache2_2.dll"

    Note: If you have chosen to install PHP is a different folder and not C:/PHP, you have to change the path in the above line.
  • Find the "AddType" section and put in the line below - [Slide 8].

    AddType application/x-httpd-php .php

    Note: You can also use other file extensions for PHP like .php3 or .php4 - simply add these at the end of the above line separated by a blank space.
  • Move to the end of the httpd.conf file and add the line below - [Slide 9]

    PHPIniDir "C:/PHP"

    Note: This tells the Apache web server the location of the PHP configuration file -php.ini.
  • If you've read my instructions on installing Apache on Windows7 know that all web site files are to be kept in the htdocs folder located under the Apache install directory. This means when you load http://localhost, Apache checks the htdocsfolder - the "It works" file that's displayed the first time you test Apache installation is actually the index.html file in this folder.
    In accordance to my habit of having things organized, I like to keep web site files in their own folder away from Apache program and configuration files... something likeC:/websites. The good news is that Apache allows you to make such a change pretty easily and to do this, you need to specify this new directory path as thedocument root.
    First create a folder for your web site files - C:/websites is what I use and is a nice choice. Find the DocumentRoot "C:/Apache/htdocs" in the Apache configuration file and change it to DocumentRoot "C:/websites" - [Slide 10].
  • Lastly, change <Directory "C:/Apache/htdocs"> to <Directory "C:/websites"> - [Slide 11].

Testing the PHP installation

Save the httpd.conf file - "File" -> "Save" [Slide 12] and restart your computer. You actually don't need to restart the machine; stopping and starting the Apache service would have probably worked but I needed a cup of tea.
It's now time to test whether PHP was properly installed on Windows 7. Open a Notepad window and type in the line below exactly as it appears - you can copy-paste if you want.
<?php phpinfo(); ?>
Save this file as phpinfo.php in the document root folder which should beC:/websites if you have followed by instructions above.
IMPORTANT: By default, Notepad will save the file as .txt. So you need to select "All Files" from the "Save as type" drop down and enter the full file name in the "File name" field. Confused? Check the screenshot - [Slide 13].
Open a browser window and load http://localhost/phpinfo.php. A long page with details of the installed PHP version should display - please refer Slide 14. If you see the PHP code instead, you've probably not saved the file with a .php extension.

Installation of apache in windows 7


Install Apache on Windows 7 - how to

This page provides detailed step by step instructions on how to install Apache on Windows 7 operating system. Chances are that you would follow the Apache installation with PHP and MySQL database. These are detailed in other articles - check links at the end of this page.
Though not required for installing Apache, I suggest you check the system type - whether the Windows 7 your computer is running is 32 bit or 64 bit. This information is available from "Control Panel" -> "System and Security" -> "System" -> "System type". We'll need it when we install MySQL.

Download the Apache Windows installer file

Point your browser to the Apache download page. Click on Win32 Binary without crypto (no mod_ssl) (MSI Installer) file; for instance, I downloaded apache_2.2.14-win32-x86-no_ssl.msi. Double-click on this file to start Apache installation. If you are shown a security warning, ignore it and click "Run" to continue - [Slide 1 in the slideshow below].


  • Click on "Next" in the introductory screen - [Slide 2].
  • Select the "I accept the terms in the license agreement" radio button and hit "Next" - [Slide 3].
  • Enter localhost for both "Network Domain" and "Server Name". In the "Administrator's Email Address" field I generally type in webmaster@localhost. Move to the next screen - [Slide 4].
  • Proceed with Typical installation type, unless you want to be adventurous! - [Slide 5]
  • As you can see from the screenshot, by default, Apache is installed in a folder deep under the "Program Files folder. I don't like this and would recommend that you too change the installation directory. I like to keep things organized and prefer Apache to reside in its own folder on the C: drive. I entered C:\Apache as the destination folder and I suggest you do the same - [Slides 6 and 7].
  • To start installing Apache 2.2 on Windows 7, click on the "Install" button and sit back - [Slides 8 and 9].
  • By the way, if the installation process is interrupted by the anti-virus program on your computer, just provide permissions for it to continue - [Slide 10].
  • In a few minutes, the Apache webserver would be installed on your Windows 7 computer - [Slide 11].
  • To test the installation, open a web browser window, enter http://localhost/ in the address bar and hit the "Enter" key - [Slide 12].
  • If you get a page with the words "It works!", celebrate, because you now have the Apache web server running on your Windows 7 computer. Didn't get this message? You may need to start Apache. Go to "All Programs" -> "Apache HTTP Server 2.2" -> "Control Apache Server" and select either "Start" or "Restart". The Apache server can also be started and stopped from "Services" under the Control Panel - [Slide 13 and 14].