Tuesday, April 17, 2012

How to Install and configure PHP on windows xp with apache and MySql



1)    creat a dir named PHP in C: as C:\php
2)    Locate php.ini-production in php folder and renamed it to php.ini
3)    Open php.ini and locate extension_dir directives, uncomment and change the value into:-  extension_dir = "C:\php\ext"
4)    Still with php.ini, next you need to find output_buffering and change it to
output_buffering = Off
5)    Locate php_bz2.dll, php_mbstring.dll, php_mysql.dll, and php_mysqli.dll and uncomment it.
6)    Now we are done with the php.ini configuration, the next step would be locating Apache httpd.conf (if you didn’t change the default Apache installation directory it can be found at C:\Program Files\Apache Software Foundation\Apache2.2\conf)
7) Open httpd.conf and uncomment expires_module, headers_module, rewrite_module and then add
LoadModule php5_module "c:/php/php5apache2_2.dll"
8)    Still in httpd.conf, inside
<IfModule mime_module>
 
Add:
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
 
9)    Still in httpd.conf once again, locate
 
<IfModule dir_module>
DirectoryIndex index.html
</IfModule>
 
And replace with:
 
                        <IfModule dir_module>
                        DirectoryIndex index.html index.htm index.php
                        </IfModule>
10)   Now we’re done with httpd.conf the next step is opening 
        System Properties (Windows Key + Pause/Break or by right
       clicking My Computer and then choose Properties) and then
       choose Advanced tab and finally click on Environment Variables
 
Locate Path and then double click on it then add
              
C:\php
 
11)   Still in Environment Variables, next you need to click New System
      Variables  and then add
 
Variable name: PHPRC
Variable value: C:\php
 
12)   We’re finished with adding and editing System Variables, 
      now go to  
     C:\Program Files\Apache Software Foundation\Apache2.2\htdocs 
     and then create a new text file inside that directory named 
     test.php and open it with notepad then add this
 
<?php phpinfo() ?>
 
13)   Now we’re done with the PHP Apache integration.
      Save your work and then restart your computer
 
14)   Open your browser and type http://localhost/test.php 
      if you see the info about php in your browser then you are 
      done with apache php integration.
 
 
 
 
 

1 comment: