Drupal: Use PHP’s built-in Web server for development

If you have a Drupal site, and believe setting up yet another virtual host in Apache or nginx will consume too much of your time, you can use PHP’s built-in Web server available since version 5.4.0. Assuming your database and settings.php file are ready, with the help of a router file to mimic the behaviour of Apache’s .htaccess file, the built-in server running as a normal user should be enough:

  • In the terminal, get into the directory of your Drupal site:
cd /home/me/drupalsite
  • Copy the following code for the router:
Continue reading “Drupal: Use PHP’s built-in Web server for development”