Tags

, , ,

How to install Apache, PHP, MySQL in Windows manually

STEP 1 Install Apache
Download Apache 2.4 binaries
http://www.apachelounge.com/download/
e.g http://www.apachelounge.com/download/VC14/binaries/httpd-2.4.25-win64-VC14.zip

Extract the downloaded file in your drive C:

$ cd \Apache24\bin
$ httpd -k install
$ httpd -k start

Go to your browser and type http://localhost/
You’ll see a message “It works!”

Problem:
Installing the ‘Apache2.4’ service
(OS 5)Access is denied. : AH00369: Failed to open the Windows service manager, perhaps you forgot to log in as Adminstrator?
Solution:
You should run the command prompt as administrator.
Find Start > All programs > Accessories > Command Prompt, right click, and select ‘Run as administrator’.

STEP 2 Install PHP
Go to http://windows.php.net/download/ and download the stable thread safe release. Choose x64 for 64-bit OS or x86 for 32-bit OS.
e.g. http://windows.php.net/downloads/releases/php-5.6.30-Win32-VC11-x64.zip

Note: Make sure that your Apache and PHP should matched with their bit either 64 or 32-bit.

STEP 3 Configure Apache and PHP
Extract the downloaded file in your drive C:
Edit the file httpd.conf from C:\Apache24\conf and add the ff. lines:

...
LoadModule php5_module "C:/php-5.6.30-Win32-VC11-x64/php5apache2_4.dll"
AddHandler application/x-httpd-php .php
PHPIniDir C:/php-5.6.30-Win32-VC11-x64
...
...

In the same file. Search for the line starting DirectoryIndex. Change it as follows:

DirectoryIndex index.php index.html

Now, navigate to C:\php-5.6.30-Win32-VC11-x64, and copy php.ini-development to php.ini. Edit this file, find the following lines and modify them as follows (all should exist already):

memory_limit = 256M
post_max_size = 128M
upload_max_filesize = 128M

## Next, add the following extensions:
extension=php_curl.dll
extension=php_gd2.dll
extension=php_mbstring.dll
extension=php_mysql.dll
extension=php_mysqli.dll
extension=php_pdo.dll
extension=php_pdo_mysql.dll
extension=php_xmlrpc.dll

STEP 4 Test and debug
Navigate to C:\Apache24\htdocs and create a file called test.php
<?php phpinfo();

STEP 5
Download mysql at https://dev.mysql.com/downloads/windows/
Download phpmyadmin using Composer.

$ composer create-project phpmyadmin/phpmyadmin --repository-url=https://www.phpmyadmin.net/packages.json --no-dev

Advertisements