, , ,

How to install Apache, PHP, MySQL in Windows manually

STEP 1 Install Apache
Download Apache 2.4 binaries here at http://www.apachelounge.com/download/
e.g For 64 bit 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 (or if using Git bash use ./httpd)
$ httpd -k start

If you got an error that says “…error while loading shared libraries: VCRUNTIME140.dll: cannot open shared object file: No such file or directory”
We need to install the first the run-time Visual C++ Redistributable for Visual Studio 2015: vcredist_x64.exe(64bit), vcredist_x86.exe(32bit)
Go here to download the file https://www.microsoft.com/en-ph/download/details.aspx?id=48145

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

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?
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 or uncomment(remove the ; ) the extension_dir and its extension DLL files.

extension_dir = "C:\php-5.6.30-Win32-VC11-x64\ext"

Everytime there’s a changes in the config we need to restart the server.
$ httpd -k restart

STEP 4 Test and debug
Navigate to C:\Apache24\htdocs and create a file called phpinfo.php
<!–?php phpinfo();
Then type this url in your browser: http://localhost/phpinfo.php you should see the PHP information.

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