Local development tools for Drupal

Submitted by admin on

When developing a website it will make the process much easier if you can develop the whole stack on your local PC. Lots of tools exists to help you with this, some examples are Docker, Vagrant and Ddev.

DDEV[1] is a docker configuration that handles all you need to develop a Drupal site.  The link should provide you with more background information.

The following receipt would get you started with a Drupal 9 development site.

mkdir drupal9-site
cd drupal9-site
ddev config --project-type=drupal9 --docroot=web --create-docroot
ddev start
ddev composer create drupal/recommended-project
ddev composer require drush/drush
ddev drush site:install --account-name=admin --account-pass=1234 -y
ddev drush uli
ddev launch

The final launch command will start a local web browser with the link to the site.

Using Puppet

If you use Puppet for your production environment then it could be an advantage to use it in development too. Vagrant is a system that build upon VirtualBox to handle environments. You can setup a puppet provisioner to use your puppet setup in you development environment

Mysql configuration for development

When developing sites using Mysql as database you have to know the performance of you queries. Luckily Mysql provides simple tools to see which queries are sent to you mysql server instance and to se the performance of each single query.

To watch all queries sent to mysql you should execute these two lines as root user :
SET GLOBAL general_log=1;
SET GLOBAL general_log_file='/var/log/mariadb.log';

And to see the performance of the queries to see which queries needs your eyes use these two lines
SET GLOBAL slow_query_log_file='/var/log/mariadb-slow.log';
SET GLOBAL slow_query_log=1;
 

[1] : https://www.drup...uide.html

Tags

Add new comment

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.