Why use Docker?
If you use Docker, all the additional requirements (Apache, the necessary libraries, PHP, and so on) will be managed automatically. Moreover, using Docker removes any friction between development and the production environments, offering a virtual environment that's the same at all stages. That is why, nowadays, using Docker is the recommended approach for developing applications, an approach that we adopt in this book. And that is why we based this book's examples on this technology. For those of you who are not familiar with Docker, it is a system that can download (pull) a ready-to-go environment (container) and run it on your local PC. All the samples we will provide are wrapped in a docker-compose
file (a file that lists and configures the container for you), so all you need to do is to activate the environment and Docker will download all the assets required and will start it transparently. So, even if you are not well-versed with Docker, all you need to know for the purpose of this book is the following:
- Start your environment: Inside the folder where the
docker-compose.yml
file is contained, rundocker-compose up
. - Stop your environment: Press Ctrl+C on the terminal where Docker Compose was launched; this will stop everything.
- Interact with the Pimcore container: You can just run
docker-compose exec php <command>
for running a command inside the container namedphp
(in our setup, this is the Pimcore one), or just enter the container with bash and launch whatever you want by means ofdocker-compose exec php bash
.
For install Docker, which is available on Windows, Mac, and Linux, just navigate to the official documentation: https://docs.docker.com/get-docker/.
For manual installation
If you want to install Pimcore manually, you will have to configure your local machine (or server) and all its dependencies by hand. This is only if you're not using Docker, so if you want to use Docker, you can skip this section.
The only part of the book where we use this manual approach is in the following section, Installing Pimcore with Composer (without Docker), where we will explain how to carry out a Pimcore installation from scratch.
For a manual installation, you need to install all the dependencies manually, including Composer, Apache, MySQL, PHP, and the PHP libraries. The prerequisites may change with the arrival of new Pimcore versions and technology updates. So, instead of adding a copy of the official system requirements of Pimcore, we have instead provided a link to the official page with the exact specifications: https://pimcore.com/docs/pimcore/current/Development_Documentation/Installation_and_Upgrade/System_Requirements.html.
Note
Pimcore supports MySQL and the MariaDB database engine, which is, in fact, a fork of MySQL. In this chapter, we refer to MySQL because it is the most common option. We used the official docker-compose
file based on MariaDB. To avoid confusion, please consider MySQL and MariaDB as one and the same in this chapter.
All the source code is contained in the official GitHub repository for this book, which you can find at this URL: https://github.com/PacktPublishing/Modernizing-Enterprise-CMS-using-Pimcore. In this repository, you will find a folder for each chapter. Inside each folder, there will be a Readme
file with all the instructions for running the code.
For those of you who are using Docker as the environment, there are no restrictions for you regarding the operating system. For Docker compatibility and system requirements, you can check the Download section of the official Docker website.