Home > Apache, PHP, Windows > Simple Way to Install Apache and PHP on Windows

Simple Way to Install Apache and PHP on Windows

I do a bit of web development, and my preferred web application environment is PHP.  So recently I was reinstalling Apache and PHP on my Windows development computer, and I found a very easy way to get them installed silently with pretty much no hassel.  Traditionally I have done the install by manually extracting PHP and editing the php.ini and httpd.conf to load the appropriate modules.  Thanks to Nicolas his insightful instruction!

First go out and grab the compiled Windows versions of Apache and PHP:

http://httpd.apache.org/download.cgi#apache22

http://www.php.net/downloads.php

This example uses the non-SSL Apache 2.2 and the PHP 5 Win32 installer package.  There are many different install types available for PHP, I avoided the debug and the non-thread safe versions.

Now run silent installs with these switches/parameters at the command prompt for the Apache/PHP packages and restart Apache.  Make sure to include the APACHEDIR parameter when running the PHP install so it can configure Apache with the appropriate PHP module.

C:\temp> msiexec /i apache_2.2.17-win32-x86-no_ssl.msi /passive ALLUSERS=1 SERVERADMIN=admin@localhost SERVERNAME=localhost SERVERDOMAIN=localhost SERVERPORT=80 INSTALLDIR=c:\apache

C:\temp> msiexec /i php-5.2.14-win32-installer.msi /qn APACHEDIR=c:\apache INSTALLDIR=c:\php ADDLOCAL=ext_php_mssql,apache22

C:\temp> net stop "Apache2.2"

C:\temp> net start "Apache2.2"

This also includes SQL Server support for PHP if needed.  Your Windows host should now be ready to serve PHP!

References

http://www.php.net/manual/en/install.windows.apache2.php#92064

Advertisements
Categories: Apache, PHP, Windows Tags: , ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: