Fast set up of database and php (with DDEV)

By alexmoreno, 19 August, 2020

Who am I going to lie, I am a big fan, you know that already DDEV ;-).

We all know that setting up a Drupal site (or Wordpress, laravel, typo, magento, ...)  is just a breeze with DDEV. However sometimes you need something even quicker, like just a database and PHP.

I had some data recently that I needed to compare. That data was coming from multiple csv. We needed to compare which modules had installed in around 20 different sites on a single site configuration (all on independent databases). Getting that data in a Google Sheet or a spreadsheet is relatively easy but, how do you make now all queries in order to extract that juicy information?

Well, that's where DDEV came into action. Just start an instance, select PHP as project, so everything starts super quick:

ddev config --docroot . --projectname=playground --projecttype php

That's it. Run now ddev start and you have a new environment with database and PHP ready to rock.

ddev start

You could now import your database, create a new one, ... whatever you need, you have all setup and ready.

ddev import-db --target-db=importdb --src=./my-database.sql

Best of all, the whole process just took me a few minutes :-D

ddev for simple project