XAMPP-VM for Mac - tell us what you think
Hi Apache Friends!
We are excited to announce a new project we've been working on: XAMPP-VM for Mac. This new app makes it really easy to run XAMPP for Linux on your Mac with just a few clicks. No VirtualBox needed!
For the first version, we've focused on making it really easy to:
- Access and edit files by mounting them on the Mac desktop
- Access phpMyAdmin and other applications over a secure tunnel with a single-click
- Test your code running on Linux, often closer to production
In addition to the changes "under the hood", there is a new stack manager interface:
This provides a central control point to start or stop services, manage port forwarding, work with files and run commands.
Getting started
To get started with the new stack manager, launch it as usual and click the "Start" button to start the hypervisor. This will also start all the XAMPP-VM services.
You can also manage individual services from the OS X tray:
What's new: port forwarding and mounted volumes
The stack manager provides a graphical interface to forward ports between XAMPP-VM and the host system. It comes with a pre-defined rule to forward XAMPP-VM's port 80 to port 8080 on the host. So, you can now access phpMyAdmin (and other Web applications running on XAMPP-VM) by browsing to port 8080 on your host - for example, http://localhost:8080/phpmyadmin. You can also add your own port forwarding rules between the host and XAMPP-VM through the same interface.
You can now mount XAMPP directories and copy or move files between your host and XAMPP using the Finder. The "Volumes" tab of the stack manager lets you mount and explore directories.
It's now even easier to run commands on XAMPP-VM. From the stack manager page, click the "Open Terminal" button and you'll be logged in to a XAMPP-VM console with full root privileges.
Creating a PHP application
Creating a PHP application on XAMPP-VM is very easy. Here's how:
- From the stack manager's "Network" tab, enable port forwarding between XAMPP-VM's port 80 and the host system's port 8080.
- From the stack manager's "Volumes" tab, mount the /opt/lampp directory.
- Using the OS X Finder, browse to the mounted volume and create a myapp/ directory within the htdocs/ directory.
Create a simple PHP script called hello.php in the myapp/ directory with the following code:
<?php
// hello.php
echo 'Hello, world!';
Save the file and then browse to http://localhost:8080/myapp/hello.php.
You should see the output of the PHP script in your browser.
You can take the new XAMPP-VM for a test drive here.
Don't forget to post a comment to tell us what you liked (or disliked) about it. And remember that installer versions of XAMPP for OS X can be downloaded from the downloads page.