What is XAMPP
XAMPP is a free distribution package that makes it easy to install Apache Web Server, PHP, PERL, and MySQL on an OSX machine, in this case macOS Catalina version 10.15.7.
Assuming no web servers and instances of MySQL are running on the machine to be used.. Before installing XAMPP, turn off any web server and instances of MySQL running on the Mac computer.
Installing XAMPP on a Mac
- Download XAMPP for Mac OSX - At this writing the PHP 8.0 is fairly new. PHP 7.4 is an established stable version. This article shows the installation with PHP7.4.16.
Download the version indicated with the arrow in the image below - Open the downloaded file (the DMG-Image). An XAMPP icon appears on the desktop and a window with an XAMPP ican in the center.
- open the XAMPP icon. A warning may apprear that the file was downloaded from the internet.
- Enter the MAC Administrator password in the authentication popup.
- The Setup-XAMPP is shown and the installation can start
- Click/tap Next to continue
- Next steps are Component selection and Installation Location.
Leave the default as is and click Next to continue. - Information on installers. Uncheck the Learn more about Bitnami for XAMPP
Click/tap Next to continue - The XAMPP package is ready to be installed
Click next to start installation - While Unpacking files the installer shows some info.
When done click/tap Next to continue - The installation is complete.
Click/tap Finish to close the installer.
If the Launch XAMPP is checked, the application will start after closing the installer
Starting XAMPP on OSX
Authentication may be necessary. Enter the administrator password. Click/tap OK to continue
Problem starting MySQL?
If MySQL serverfails to start, change file permissions using Terminal (Launchpad -> other -> Terminal ) with this command:
$ sudo chmod -R 777 /Applications/XAMPP/xamppfiles/var
Testing your OSX XAMPP Installation
Class File Permissions
- Cmd+click on Finder -> Applications -> XAMPP -> xamppfiles -> htdocs folder and select Get Info.
- If the lock symbol at the bottom indicates that this information is locked, click/tap the lock icon to unlock, and enter user credentials.
- Once the settings are unlocked, choose "everyone" under "Sharing & Permissions" and change the option to "Read & Write".
Setting the MySQL Password on Macs
- The PHP files use "pwdpwd" for the MySQL root password, while the default password is NO password.
- Change the password to pwdpwd by opening Terminal (Applications > Utilities > Terminal) and enter:
$ sudo /Applications/XAMPP/xamppfiles/xampp security
Enter your Mac password if requested and click/tap OK.
Next will ask if you want to turn off XAMPP access from the network: answer: Yes
Next for MySQL: answer No
Next for MySQL/phpMyAdmin user: Answer No
.
The next statement displayed: MySQL has no root password set
Do you want to set a password?
Enter Yes- Enter the password pwdpwd.
- Enter the password pwdpwd again
In the Terminal Window, it looks like the following:root@Lukes-MacBook-Pro htdocs # sudo /Applications/XAMPP/xamppfiles/xampp security
XAMPP: Quick security check...
XAMPP: MySQL is accessable via network. XAMPP: Normaly that's not recommended. Do you want me to turn it off? [yes] Y
XAMPP: Turned off.XAMPP: Stopping MySQL...ok.
XAMPP: Starting MySQL...ok.
XAMPP: MySQL has to run before I can check the security.
XAMPP: The MySQL/phpMyAdmin user pma has no password set!!!
XAMPP: Do you want to set a password? [yes]
XAMPP: MySQL has to run before I can check the security.
XAMPP: MySQL has no root passwort set!!!
XAMPP: Do you want to set a password? [yes]
XAMPP: Write the password somewhere down to make sure you won't forget it!!!
XAMPP: Password: XAMPP: Password (again):
XAMPP: Setting new MySQL root password.
XAMPP: Change phpMyAdmin's authentication method.
XAMPP: The FTP password for user 'daemon' is still set to 'xampp'.
XAMPP: Do you want to change the password? [yes]
XAMPP: Reload ProFTPD...ok.
XAMPP: Done.
root@Lukes-MacBook-Pro htdocs # - Quit Terminal (Cmd+Q) and restart Apache and MySQL using the XAMPP Control Panel.
Testing phpMyAdmin
- Go to http://localhost
- Click on phpMyAdmin under Tools
- Enter 'root' for username
- Enter 'pwdpwd' for password
The next step is to create a webpage and post it on the webserver at $ /Application/XAMPP/htdocs/
How to create a website is beyond this How To.
A number of Content Managing Systems (CMS) are free, most known are WordPress, Drupal, Joomla.
For more on free CMC look here
Happy Mac XAMPPing!