Thursday, June 14, 2007

PHP tutorial and guideline


After you have installed Apache on your PC, It is the time to set up PHP.PHP is a recursive acronym for "PHP Hypertext Preprocessor".It has evolved from the "Personal Home Page" tool create in 1994 by independent I.T. contractor,Rasmus Lerdorf, to track users accessing his website. He developed PHP into a scripting engine with a "Form Interpreter" released in 1996 as" PHP-FI".The advantages of PHP is free download from

www.php.net

It allows anyone with a basic knowledge of HTML to start intergrating PHP into their web pages straight aways. PHP's modular system of extensions allow it to interface with different libraries, such as encryption, graphics or XML and adding further extensions is very simple.

1.First you need to Windows Explorer,
go to c:\downloads\php5 and unzip the file php-5.0.2-Win32.zip into the directory
called C:\download\php5\php-5.0.2-Win32.

2.You now want to MOVE all the unzipped PHP5 files and directories to c:\php.

3.So in Windows Explorer,go to C:\download\php5\php-5.0.2-Win32\ and press CTRL-A to
select all the files,then press CTRL-X to copy them.

4.Now create a directory called c:\php and copy all the files into that directory by
going to it and pressing CTRL-V.

5.If you have completed this step correctly, you will see in the c:\php directory four folders
and over20 files. Now move (don't just copy) the file c:\php\php5ts.dll to
c:\windows\php5ts.dll (or if you don't have a c:\windows directory, move it to c:\winnt).


Now is working Apache with PHP.....................................

1. With the Windows Explorer, create the folder c:\webs\test. This will be our test website.

2. Rename the c:\php\php.ini-dist to c:\php\php.ini, then make the following changes in the
c:\php\php.ini file: (1) doc_root = "c:\webs\test" and (2) extension_dir = "C:\php\ext".

3. In the file C:\Program Files\Apache Group\Apache2\conf\httpd.conf, change the DocumentRoot
entry to: DocumentRoot "C:/webs/test".

4. Also in the file C:\Program Files\Apache Group\Apache2\conf\httpd.conf, change the Directory
entry to: .

5. Again in the C:\Program Files\Apache Group\Apache2\conf\httpd.conf file, add the following lines:

[ScriptAlias /php/ "c:/php/"]
[AddType application/x-httpd-php .php .php5]
[Action application/x-httpd-php "/php/php-cgi.exe"]
[SetEnv PHPRC "C:/php"]

6. Lastly, we need to make one last change to this C:\Program Files\Apache Group\Apache2\conf\httpd.conf file.
Find the "DirectoryIndex" entry and add "index.php" to the end of the line as shown in this screenshot.

[DirectoryIndex index.html index.html.var index.php5]



Add to My Yahoo!


Add to Google

No comments: