How to install Apache and PHP without installers
Installing and configuring both Apache and PHP without using their installers is important because the later versions of both Apache and PHP are not bundled with installers, so it's the key to using the later versions of these products.
General points:
1. Must not mix 32 and 64 bit versions of Apache and PHP, will not work. PHP considers their 64 bit product to be experimental, so this implies only using the 32 bit versions of Apache.
2. Per PHP, Apache downloads should come from http://www.apachelounge.com/.
3. Compiler version of PHP and Apache must match. There are VC6, VC9, and VC11 versions. Both Apache and PHP must use the same compiler version.
4. VC6 is not recommented because it is old.
5. VC9, and VC11 both require certain MS run time products (free download). http://www.php.net explains this and provides download links to MS.
Steps:
1. install Apache first. Download the .zip, and place the Apache folder inside on the c:\ drive.
1.1 install MS redistributable for Visual Studio 2012 at: http://www.microsoft.com/en-us/download/details.aspx?id=30679
1.2 Add "ServerName localhost:80" to httpd.conf
1.3 Add:
# Fix IE Apache 2.4 hangs
AcceptFilter http none AcceptFilter https none
uncomment line #154: LoadModule rewrite_module modules/mod_rewrite.so
to httpd.conf. See: https://httpd.apache.org/docs/trunk/da/mod/mpm_winnt.html
1.4 Turn Apache directory listing off in httpd.conf
Options Includes Indexes FollowSymLinks MultiViews
then remove word Indexes and save the file. The line should look like this one:
Options Includes FollowSymLinks MultiViews
2. Use httpd.exe (via command window) to manually execute.
3. Use httpd.exe -k install to install as a windows service.
4. Uninstall any service (if desired) via sc delete "seervice name" (in command window)
5. Install PHP next by downloading .zip, then copying the php folder to the c:\ drive.
6. Add c:\php and c:\php\ext to the windows system PATH environment variable.
7. Download http://pear.php.net/go-pear.phar and place in c:\php folder.
7.1 via DOS: php go-pear.phar to install PEAR
8. configure and install pear per PHP installation notes kb at: http://www.jargonsoft.com/support/knowledgebase.php?article=1
9. PHP 7 requires this in php.ini to enable ODBC support:
extension=php_odbc.dll
10. Append to end of httpd.conf file:
#BEGIN PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL
PHPIniDir "C:\PHP\"
LoadModule php5_module "C:\PHP\php5apache2_4.dll"
AddType application/x-httpd-php .php
#END PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL
11. Append to end of php.ini file:
[PHP_CURL]
extension=php_curl.dll
Beware that a folder must be specified to cache uploaded large HTTP Post bodies.
upload_tmp_dir must point to a valid folder in php.ini (or leave blank to use system default temp folder).
See: http://www.jargonsoft.com/support/admin/knowledgebase_private.php?article=262&suggest=1
Notes about OpenSSL: 10-2019
must have system environment OPENSSL_CONF pointing at openssl.cfg file.
must use Listen <port> to specify SSL port to use.
use virtual host to define the SSL like this example:
<VirtualHost 192.168.1.248:4444>
DocumentRoot "c:/apache2/htdocs"
ServerName mobile.trepco.com
SSLEngine on
SSLCertificateFile "c:/apache2/conf/mobile_trepco_com.crt"
SSLCertificateKeyFile "c:/apache2/conf/mobile_trepco_com.key"
SSLCertificateChainFile "c:/apache2/conf/DigiCertCA.crt"
</VirtualHost>
If IIS is desired instead of Apache, use: http://php.net/manual/en/install.windows.iis7.php