Tuesday, April 14, 2009

Apache + PHP (Windows) Step-By-Step

  1. Download the 2.2.11 windows binary from Apache
  2. Run to install Apache. Assuming you are installed to C:\Program Files\Apache Software Foundation\Apache2.2
  3. Download the PHP windows binary (Zip Package) from PHP.net
  4. Unzip the package and put everything inside c:\php
  5. Copy c:\php\php.ini-recommended to c:\php\php.ini
  6. Assume your web root folder is C:\WebRoot
  7. Edit the php.ini

  8. doc_root = "C:\WebRoot"


    upload_max_files = 10M /* Modify the maximum upload file size to 10 megabytes, default 2 M */

    uncomment the following line for using MySQL or other lines for other database
    extension=php_mysql.dll
    extension=php_mysqli.dll

  9. Edit the Apache conf\http.conf

  • Change the DocumentRoot to your webroot
  • Change the <Directory "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs"> to <Directory "C:/WebRoot">
  • Change the Deny from all to Allow from all
  • Add the following line to conf\http.conf
    # Configure the path for php.ini
    PHPIniDir "C:/php"
    LoadModule php5_module "C:/php/php5apache2_2.dll"

No comments:

Post a Comment