Local Pimcore Dev Using XAMPP-VM

I'd like to preface this post and mention that this is an adaptation to a methodology that we are currently experimenting with at the agency where I lead development efforts currently. This post may at some point become outdated or additional findings may in the future suggest a better approach to some of the concepts contained herein. Nevertheless, here is our current process.

Getting Started with XAMPP-VM

This process can be used to quickly spin up a local Pimcore development environment and attach it to an existing repository. The following routines ashould be performed at least once on your VM, but are not require to be completed when standing up additional projects on an already-configured VM installation.

Download & Install XAMPP-VM

  1. Download and install XAMPP-VM / PHP 7.1.23 for your Mac.
  2. Launch and Start all services from the XAMPP-VM application.

Updating XAMPP-VM

apt-get update
apt-get upgrade

Configure Apache2 in XAMPP-VM

If you intend to use this workflow for more than one project, this configuration alteration will allow you to define individualized docroots for each of your installations.

  1. Mount the /opt/lampp drive volume from the XAMPP-VM application and navigate to the etc/httpd.conf file.
  2. Uncomment by removing the # character at the beginning of the line: #Include etc/extra/httpd-vhosts.conf.
  3. Make sure any alterations you've made are saved. Restart all XAMPP-VM services from the application.

Configure PHP 7.1.x in XAMPP-VM

You might need to modify some PHP settings to get your application to work correctly. The following steps demonstrate how to remove the memory limitation for PHP. You can use this process to update and configure PHP as you see fit. Keep in mind however, that these settings are shared across your different projects, so it's better to use settings that are more generic and can work in most places. You'll also want to follow best practices configuring your production environment when you're ready to deploy your project.

  1. Mount and Explore the /opt/lampp drive volume from the XAMPP-VM application and navigate to the etc/php.ini file.
  2. Update the memory_limit value to use -1.
  3. Make sure any alterations you've made are saved. Restart all XAMPP-VM services from the application.

Configure MariaDB in XAMPP-VM

If this is your first time working with your XAMPP-VM installation, you will likely need to define a password for your MySQL root user. That can be done easily from any location in your VM terminal.

mysqladmin -u root password .

Configure ProFTPD in XAMPP-VM

Due to some of the constraints in how XAMPP-VM operates it's environment through a mounted volume, accessing the filesystem is like accessing a remote server, but that remote server is on your local machine. To ensure that you have read and write permissions for the mounted filesystem, perform the following commands in the XAMPP-VM terminal.

cd /opt/lampp
chown -R daemon:daemon htdocs

Restart the ProFTPD service from the XAMPP-VM application. You should now be able to connect to the ProFTPD service by using an FTP client like FileZilla using the following credentials:

Host: 192.168.64.2
User: daemon
Pass: xampp

Note: your host IP address might differ from this one, but you can easily locate the correct value to use from the XAMPP-VM General tab.

Installing Composer in XAMPP-VM

cd ~
curl -sS https://getcomposer.org/installer | /opt/lampp/bin/php
mv composer.phar composer
mv composer /usr/local/bin