How to Configure Apache 2.2.10, PHP 5, MySQL 5 for Web-application Development
2 min readMar 3, 2020
How to configure Apache, PHP, MySQL web-development platform. First step to test with Drupal/Joomla. Just short-notes. I assumed that you will read it right.
- Download PHP 4/5 MySQL 4/5 Apache 2, Drupal
- Drupal
- Install all of them. Unzip them. Then clicking on the exe/msi file will do the work. Just unzipping can be fine for PHP 4/5. However, in the Internet, you will find .exe/.msi installations also
- My focus will be on: MySQL 5, PHP 5, Apache 2.2.10
- After you install PHP 5, rename php.ini-recommended to php.ini
- enable MySQL support (in php.ini file): remove ‘;’ before extension=php_mysql.dll and extension=php_mysqli.dll
- in php.ini file make/adjust the following changes
- doc_root = “E:/completely_new_web_stuffs/justetc” //point to the root of your web-sites = the document root of your apache web-server = the same path as used for DoCRoot variable for Apache [httpd.conf file]
- extension_dir = “C:installed_programslampphp5ext” //for php 4 it will be extensions directory
- session.save_path = “c:/temp” //create a temporary folder and use it here
- Copy php.ini file to your Windows directory
- For PHP 4, copy all .dll files from dll folder to windows/systems directory
- For PHP 5, better search for all .dll files and copy them to windows/system directory
- Now focus on, Apache 2.2.10 — remember it is not Apache Tomcat but Apache HTTP server
- Look for httpd.conf under conf directory in Apache installation folder
- Points of attentions in httpd.conf file
- ServerRoot “C:/Program Files/Apache Software Foundation/Apache2.2” //point to the apache installation
- LoadModule php5_module “C:installed_programslampphp5php5apache2_2.dll” //add this line so that apache can work with php (in the LoadModule section) . If you want PHP to run as CGI then you do not need this line. Rather you need similar lines like the following: 1. ScriptAlias /php/ “c:/php/” 2. Action application/x-httpd-php “/php/php.exe”
- For PHP 4, the LoadModule may look like this: LoadModule php4_module “C:installed_programslampphp4/php4apache2.dll”
- DocumentRoot “E:/completely_new_web_stuffs/justetc” : point to the root of your web-sites
- Replace all paths [in httpd.conf] related to DocumentRoot with the right value [our case: E:/completely_new_web_stuffs/justetc]
- In the AddType section, add: AddType application/x-httpd-php .php
- Make sure you have index.php in your DirectoryIndex as: DirectoryIndex index.html index.php
- Set the Port: Listen 80
- Notes:
- You can run Apache server as windows service or you can start it using command line
- Many prefer the command line approach.
- If configured as windows service, some of the errors (start/stop) can be viewed from the windows Event viewer.
- Apache installation directory will have a log folder. The log folder contains files to keep error/access/install logs/errors/warnings