Posts Tagged ‘PHP’

Simple Way to Install Apache and PHP on Windows

November 10, 2010 Leave a comment

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:

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!


Categories: Apache, PHP, Windows Tags: , ,