Thursday, December 26, 2013

PHP, Apache and MySQL configuring manually in Window 7 64bit

Apache 2.4 Install

Download Apache 2.4 from http://www.apachelounge.com/download/ (apache_2.4.2-x64-openssl-1.0.1c ).


The following steps will walk you through the installation:
  1. Select Next
  2. Select "I accept the terms in the license agreement"
  3. Select Next
  4. Fill in your server information if it is known. A typical setup will use the "for All Users, on Port 80, as a Service" option. If this is being setup as a test machine, you may use localhost as the Network Domain and the Server Name. Select Next.
  5. Select the Typical Setup
  6. Choose a Destination Folder for the Installer to place the program files into. Note: the default Apache Installer location is C:\Program Files\Apache Software Foundation\Apache2.4. Because of the spaces in the directory name, using this folder may cause cgi and php scripts to not find the paths correctly.
  7. Select Finish
  8. If a Firewall is enabled, make sure that port 80 and port 8080 are unblocked and open.
  9. To test if the Apache server is running, open up http:\\localhost in a browser. A plain black and white page should come up that reads "It Works!"

Configuring Apache:

  1.  Using a text editor such as Notepad, open the httpd.conf file. This file is found in the /conf sub-directory under the directory that was set up during installation.
  2.  In the Apache configuration files,(forward slashes) / should be used in path names. 
  3. Change the DocumentRoot to point to the location of the root document folder. It would point to "C:/Program Files/Apache Software Foundation/Apache2.4/htdocs". 
    Note: Wrapping the path name in quotes will escape out any spaces that are used.
  4. Change the Directory path to match the one used in the previous step. This is found on line 177 of the default httpd.conf file.
  5. Add to index.php to the DirectoryIndex(replace the index.html)
  6. Append the following lines to the end of the httpd.conf file:
           LoadModule php5_module "c:/php/php5apache2_4.dll"
           AddType application/x-httpd-php .php
           PHPIniDir "C:/php"
  7. Save and Close.

Download PHP:

     Download php from http://windows.php.net/download/

Installing PHP:

  1. Unzip the PHP files to C:\php
  2. Copy c:\php\php-ini-recommended.ini and rename itc:\php\php.ini
  3. Uncomment the Windows include_path.
    Note: In the PHP.ini file, semicolons are used to denote that something is commented out. To uncomment a line, simply remove the semicolon.
  4. Update the doc_root to match the one that was set up in the httpd.conf file. 
    Note: The PHP INI files uses the Windows style backslash \ for path names.
  5. Update the extension_dir on line 520 to "C:\php\ext"
  6. Uncomment php_gd2.dll extension.
  7. Uncomment mysql.dll extension.
  8. Update the sessions.save_path to the Windows temporary files directory (i.e. C:\Temp).
  9. The PHP directory needs to be added to the Path Environment Variables
    1. Open the Control Panel
    2. Open System > Advanced > Environment Variables
    3. Append ;C:\php to the end of the Path System Variables list and Click OK.
  10. Restart Apache
  11. To test PHP on Apache, go to the root directory (i.e. C:\Program Files\Apache Software Foundation\Apache2.2#92;htdocs) and create a new php file in it. In this file, use PHP's phpinfo() function to see the server's configuration information. For example: 
    <html>
    <body>
    <?php phpinfo() ?>
    </body>
    </html>


 


No comments:

Post a Comment