Drupal 8 – A Bold and Daring Release Pt.1

Now that I’ve been messing around with Symfony2 for a few weeks, exploring Drupal 8 sounds like a lot of fun. For all the success the Drupal team has had, they are not sitting back and relaxing. Drupal 8 is a bold and daring release of the CMS where we will see the entire architecture refactored to become a Symfony2 application. Wow! This will be incredibly interesting to see – a massive job and if successful could yield quite a number of benefits. D8 is still a few months out I think, but let’s check it out!

What is Drupal 8?

Its typical open-source to make it challenging to find a good description of the goals and main features expected in the release. Here’s some links I’ve found helpful for understanding what’s in this release compared to Drupal 7:

  • Drupal Core: project page for the main drupal core team. There’s detailed scrum team status on each feature set on this page.
  • Drupal Planet: Verious blog posts with recent good ones on Drupal 8
  • Media Current:this random post seems to have the best list of what to expect.

For me the main interest in Symfony2 and how they will use it. I’m going to clone the git repo and get a dev environment setup on my MBP laptop. I’ve got the typical stack of PHP and Apache running and I’ll be using PHPStorm from JetBrains for developing – this tool has great support for Symfony2 coding.

Setup and Initial Thoughts

Setting up is pretty easy – just look here. I’ve already got MySQL installed so I’ll use that and I need to make some adjustments to my virtual hosts configuration. Other than that, just git the code, create a database, and do the regular dance with the config page as usual for Drupal.

I was getting this odd message when the installer was checking my config:

The service definition “request” does not exist.

I determined that this was caused by the files directory not have write permissions for the installer. I fixed that with drupal 8 installer\a simple chmod to allow the webserver user to have write access to that directory. Be careful in prod with this kind of thing!

Post Install – How do things Look?

Once I had things installed I decided to check out the candy store. But….ooops….home page looks wonderful, but clicking on anything just throws 404 errors. What’s going on? Looks like some kind of routing snafu. In Drupal8 “friendly urls” are now required so you need to enable mod_rewrite in your apache configuration. This is pretty simple – just make sure the module is listed in your apache conf file with this line:

LoadModule rewrite_module modules/mod_rewrite.so

Then add a re-write rule to your httpd-vhosts.conf file. I like to also include an easy domain for my drupal site. To do this first add an entry to your hosts file – for example: 127.0.0.1 drupal8.local.hob and then add this block to your httpd-vhosts.conf file:

<VirtualHost *:80>
  ServerName drupal8.local.hob
  ServerAlias drupal8.local.hob
  DocumentRoot "/Library/WebServer/Documents/d8"
  DirectoryIndex index.php
  <Directory "/Library/WebServer/Documents/d8">
    Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
        <IfModule mod_rewrite.c>
          RewriteEngine on
          RewriteBase /
          RewriteCond %{REQUEST_FILENAME} !-f
          RewriteCond %{REQUEST_FILENAME} !-d
          RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
        </IfModule>
  </Directory>
</VirtualHost>

Re-start apache and you should be able to hit your local Drupal instance using the hosts entry domain name. Same warning as above – make sure you know what you are doing if working on a prod site – I’m just messing around with a scratch instance.

Here’s the admin screen –>Drupal 8 Admin

Looks pretty normal. Performance seems pretty snappy as I poke around. I tested adding some content: articles and things. Seems to work. I had a couple of strange errors – found some funky things missing in my database.

I decided to just re-build everything. To do this just delete your settings file and re-install. I dropped the database, recreated it, re-ran install and now everything is working great. Not too shabby for a Sunday morning. I’m going to take a break and come back later to with Part 2 on Drupal 8. I’ll be focusing on installing a few simple things and trying to understand how Symfony2 is being used. I see some yaml files around, but so far that’s it. I’ll also get the project configured in PHPStorm – that should be interesting.

1 Comment

  1. Pingback: ralph lauren

Leave a Reply