b:include data='blog' name='all-head-content'/> Installing Apache PHP and MySQL on Window Vista: Installing PHP 5.2.5
Your Ad Here
Your Ad Here

Installing PHP 5.2.5

Steps to setting up PHP 5.2.5 :

1. Install PHP :

First, extract the PHP package to “C:\PHP\”(make a new
folder name it as “PHP” and extract files in this folder).
Then make a copy of the file “php.ini-recommended” in
PHP directory and rename it to “PHP.ini”. This is the PHP
configuration file and we'll take a look what's in it
later on.

2. Up graders :


Remove the Old PHP.INI File from Your Windows Directory
If you are upgrading to PHP 5 from an older version, go to

your windows directory, typically “c:\windows”, and
delete any php.ini file that you have previously placed
there.

3. Modifying PHP Configuration File (php.ini) :


Now, open “php.ini” in some text editor. I am using

EditPlus 2” you can choose editor of your choice and
make following changes:

Document Root :

Search for the line that reads “doc_root = ” and replace

it with doc_root = C:/Apache/htdocs” and then search
for “; cgi.force_redirect = 1” and replace it with
cgi.force_redirect = 0” (*document root path in php.ini
should be the same as document root path in httpd.conf
in apache server).

Short Open Tags :


Search for the line that read
short_open_tag = Off” and replace it with
short_open_tag = On” (* it helps to recognise tags like
as start tag for a PHP script).

Magic Quotes :


Similarly, replace “magic_quotes_gpc = Off” with

magic_quotes_gpc = On”(*this allows your input data
to have the backslash (“\”) prefix).

Register Global :


Verify that register_globals is set to Off
register_globals = Off” (*if it is set On, it will allow
to write insecure codes).

Modifying Apache Configuration:

Apache doesn't know that you just install PHP. We need
to tell Apache about PHP and where to find it:

1. Open the Apache configuration file in
C:\Apache\conf\httpd.conf” and add line
PHPIniDir "C:/PHP/" to the top of the file (*this line
indicates the location of php.ini).

2. Add the following lines to the end of the file:


ScriptAlias /php/ "C:/PHP/" (*this line adds script alias

for “cgi-bin”).

Action application/x-httpd-php "C:/PHP/php-cgi.exe"
(*this line tells the server to execute the PHP executable
each time it encounters a PHP script).

AddType application/x-httpd-php-source .phps

(*this line is added so that you can view your php file
source code in the browser window).

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

(*this line tells Apache where to load the dll required to
execute PHP).

If you create a file index.php, and want Apache to load

it as the directory index page for your website, you will
have to add another line to the "httpd.conf" file. To do
this, look for the line in the file that begins with
"DirectoryIndex" and add "index.php" to the list of files
on that line. For example, if the line used to be:
DirectoryIndex index.html” change it to
DirectoryIndex index.php index.html”.

Now restart Apache for the changes to take effect
(Start >Programs >Apache HTTP Server 2.2.6 >

Control Apache Server >Restart) .

Open the folder “C:\Apache\htdocs” and delete all the
existing items from it.

To check if everything is okay create a new file, name

it as “test.php” and put it in document root directory
(C:Apache\htdocs). The content of this file

is “< *? phpphpinfo(); *?>” (remove * sign before ?
to get actual content of this file).

phpinfo() is the infamous PHP function which will spit
out all kinds of stuff about PHP and your server
configuration. Type “http://localhost/test.php” on your
browser's address bar and if everything works well you
should see something like this:














also visit:http://webdeeksha.blogspot.com/


Your Ad Here