• MySQL Some years ago it was only possible to do local development using a local installed PHP version, a local installed database and a local installed web server on your development machine.
The disadvantage of this solution is, if you have to work with different projects that need different PHP versions, you have to install more than one PHP version and have to handle that the different projects use the correct PHP version when you switch between the projects.
You also have to set up the network configuration for the hostname resolution if you don’t want to use localhost or the IP address. And you have to configure the web server to serve the content from the right directory. This could result in a lot of needless work.
TYPO3 Developer Days 2018 And then There were people who think this must be done more easier and they made packages which are containing a web server, a database and some PHP versions. The installation is easier, only one program to install. The configuration is also a lot easier. You can configure all needed settings in one user interface.
TYPO3 Developer Days 2018 integrated packages • LAMP
• WAMP
• MAMP
• AMPOS2
• XAMPP These packages are already known as LAMP, WAMP, MAMP, AMPOS2 or XAMPP.
In this abbreviations the A stands for the Apache web server, the M stands for the MySQL database server, the P stands for PHP and the other letters are standing for the operating system, L for Linux, W for Windows, M for MacOS and OS2 for OS/2 and eComStaion.
The X in XAMPP stands for cross-platform and the second P stands for Perl.
The most used package today is XAMPP I think, and that is brought to us by the Apache Friends.
TYPO3 Developer Days 2018 https://www.apachefriends.org/de/index.html Using these packages reduces the time to set up a local environment a lot in comparison to the native installation of the single components.
But these solutions also have drawbacks. XAMPP for example has PHP configured as an Apache module what makes it impossible to use different PHP versions at the same time.
TYPO3 Developer Days 2018 virtual machine • VirtualBox
• VMWare Next in time virtual machines came up. Solutions like VMWare or VirtualBox could be used to set up a virtual machine per project. With all project specific settings separated from other projects. The disadvantage is that you have to set up a complete server image with an operating system and a development environment including the web server, database server and PHP by yourself.
TYPO3 Developer Days 2018 https://www.michielroos.com/articles/the-one-stop-typo3-vagrant-development-box.html And there is one special Vagrant Box called TYPO3.Homestead which is maintained by Michiel Roos.
I have used this box for some time to review patches for the TYPO3 core very easily.
My scripts for doing this were adopted from Michiel and are included in the TYPO3.Homestead box. It is no longer maintained because creating it with current TYPO3 versions results in a very large virtual machine, so it has to be redesigned.
• Docker Then the container technology comes up where programs are running as isolated processes in user space sharing the OS kernel with other containers.
TYPO3 Developer Days 2018 Docker One of these container technologies is called docker.
There are a lot of ready to use containers for web servers, database servers and programming languages like PHP, Perl and so on.
The complexity is to find the right containers and orchestrate them in the right way to work smoothly together using Docker Compose. Compose is a tool for defining and running multi-container Docker applications.
You have to configure how the different container are interacting together and with the outside with writing more or less complex docker configuration files.
TYPO3 Developer Days 2018 And then There are the people from Drud Technology which combines some container with an easy to use command line interface what they called DDEV.
TYPO3 Developer Days 2018 DDEV • Open Source Tool to set up a local PHP development environment in shortest time
• Use Docker without getting in touch with the configuration DDEV is an Open Source Tool to set up a local PHP development environment in shortest time.
It uses Docker without getting in touch with the configuration of the docker container.
TYPO3 Developer Days 2018 DDEV Installation • Requirement: Docker
• Requirement: Docker Compose
• Information about the Installation of DDEV and the requirements: https://ddev.readthedocs.io/en/latest/ All you need before installing DDEV is an installed version of docker and docker-compose.
Detailed information about the installation and the requirements of DDEV you can find in their documentation.
TYPO3 Developer Days 2018 Creating a new ddev project config in the current directory (/Users/michael/Source/ddev/v9test) Once completed, your configuration will be written to /Users/michael/Source/ddev/v9test/.ddev/config.yaml Project name (v9test): The docroot is the directory from which your site is served. This is a relative path from your application root (/Users/michael/Source/ddev/v9test) You may leave this value blank if your site files are in the application root Docroot Location: web Found a typo3 codebase at /Users/michael/Source/ddev/v9test/web. Application Type [backdrop, php, drupal7, drupal8, wordpress, drupal6, typo3] (typo3): Configuration complete. You may now run 'ddev start'. ddev config
TYPO3 Developer Days 2018 Starting environment for v9test... Starting ddev-v9test-db ... done Starting ddev-v9test-dba ... Starting ddev-v9test-web ... done Network ddev_default is external, skipping Creating ddev-router ... done Successfully started v9test Your project can be reached at http://v9test.ddev.local and https://v9test.ddev.local ddev start
TYPO3 Developer Days 2018 NAME TYPE LOCATION URL(s) STATUS v9test typo3 ~/Source/ddev/v9test http://v9test.ddev.local running https://v9test.ddev.local Project Information ----------------- PHP version: 7.2 MySQL Credentials ----------------- Username: db Password: db Database name: db Host: db Port: 3306 To connect to mysql from your host machine, use port 32800 on 127.0.0.1. For example: mysql --host=127.0.0.1 --port=32800 --user=db --password=db --database=db Other Services -------------- MailHog: http://v9test.ddev.local:8025 phpMyAdmin: http://v9test.ddev.local:8036 DDEV ROUTER STATUS: healthy ddev describe
TYPO3 Developer Days 2018 Import Data ddev import-db —-src=mydata.sql.gz It is really easy to import the data of your project.
For the database you can import the SQL file of your projects database to the DDEV database.
This can be done after starting the container with the import-db parameter of the DDEV command. Plain text and compressed files can be used as source for the import.
There is also an import-files command but that doesn’t work for TYPO3 at the moment.
For the files you can add a copy of your fileadmin folder to the project directory.
TYPO3 Developer Days 2018 Summary • Install project files in a directory
• Configure the project with ddev config
• Start the project with ddev start
• Optional: Import data with ddev import-db Let us summing up what we have learned.
You have to install your project files in a directory. This depends on your project settings. Installing via composer, from a source download or with a git checkout, all is possible.
After you have configured the project you can start the container and work on your project.
TYPO3 Developer Days 2018 Information • Who has it developed? DRUD Technology, LLC https://www.drud.com
• Interview on the TYPO3 YouTube Channel https://www.youtube.com/watch?v=Xz8tE2Vzngo&t=850s
• Documentation https://ddev.readthedocs.io/en/latest/ • Source https://github.com/drud/ddev • DDEV on Slack #ddev You have seen the different possibilities to setup your local development environment
You can use native components
You can use Virtual machines
And you can use containers
You have seen how easy it is to setup a local development environment for your projects in very short time
Take some time, after lunch, tomorrow or next week in your office and give DDEV a try.
I am shure you won’t do development without DDEV afterwards.