B.5. Installing a LAMP[44] Stack

B.5.1. Check and Clean

If you have a non running web server fron a previous life. This means any of

  • XAMPP
  • MAMPP
  • WAMPP

It must be updated ie uninstalled, and reinstalled. Period!

Uninstalling is simple, just remove its directory, folder, on your hard disk. Important: If you have documents in an htdocs, or www directory belonging to any of MAMPP, WAMPP, or XAMPP you may want to save it to another place on your hard drive before you erase MAMPP, WAMPP, or XAMPP. You can move it back to the appropriate location after the following install.

XAMPP and the others comprise the Apache Web Server, the MariDB RDBMS, and the PHP programming language. Install it by:

Mac OSX

First unload Mac's built in apache

sudo apachectl stop
sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist

Then do

brew install --cask xampp

If you moved and previous htdocs, or www directory, move it back and you are ready to roll.

MS Windows

Start cmd as administrator and do

choco install xampp-80

If you moved and previous htdocs, or www directory, move it back and you are ready to roll.

B.5.2. Install Stand Alone Web Server

No web developer lives without a running web server. Noone! If you don't want any of the above packages, but instead go for Apache, MariaDB, and PHP separately, start with Apache here:

Mac OSX

First unload Mac's built in apache

sudo apachectl stop
sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist

Then do

brew install httpd

And then

sudo brew services start httpd

The web server is now available as a service. Reach it from your browser at http://localhost:8080. It's root directory is: /usr/local/var/www All your future web work should be placed in that branch of your file system, or you must reconfigure Apache to point into your own area of the hard disk.

Ref: https://tecadmin.net/install-apache-macos-homebrew/.

MS Windows

Now we will benefit from installing Chocolatey. Start cmd as administrator and do

choco install apache-httpd

You will be asked for a "Y" a couple of times, give it, then restart when prompted. Once you have it installed, maintenance is simple. Start the CLI and do

choco upgrade apache-httpd

The web server is now available as a service. Reach it from your browser at http://localhost:8080. It's root directory is: C:\Brugere\<youruserid>\Roaming\Apache24\htdocs All your future web work should be placed in that branch of your file system.

Ref: https://chocolatey.org/packages/apache-httpd.



[44] https://en.wikipedia.org/wiki/LAMP_(software_bundle)