Try Drupal 8 Now

Try Drupal 8 Now

default avatar
Thought byJesus Olivas
December 18, 2014
FFW Blog - illustration

You may have heard and read a lot about Drupal 8 lately, without much support to go along with it. Well here at FFW, we are working on changing that and contributing as much help as we can to the community with the issues that we’ve come across so far in Drupal 8. In this post I will show you how you can try Drupal 8 by installing dependencies such as composer and drush so you can have a Drupal 8 site running on your local machine.

Disclaimer:

For this blog post I will be using Mac OS X Yosemite which is the OS I have on my development machine.

To follow this walkthrough you should have an *AMP stack installed and working on your machine. If you don’t already have an environment, here are some options: 

* Mac: Acquia Dev DesktopMAMP or php-osx
* Windows: XAMPPWAMP or Ampps
* Linux: Install with your package manager or Ampps
* Use a Virtual Machine

Whichever environment you choose, make sure you have the following:

* PHP 5.4.5 or higher (very important!)
* A MySQL server that is configured to work with PHP

Download and Install Composer

Composer is a dependency management library for PHP. Follow the instructions from the composer website at https://getcomposer.org/download. You can download it anywhere onto your local computer. 

Then, if you have curl installed:

$ curl -sS https://getcomposer.org/installer | php​

Or if you don't have curl installed:

$ php -r "readfile('https://getcomposer.org/installer');" | php

Accessing composer from anywhere on your system:

To access composer globally move the executable 'composer.phar' to a directory that is already in your PATH.

$ chmod +x composer.phar
$ mv composer.phar /usr/local/bin/composer

Download Drush

Clone the drush git repository in a directory that is outside of your web root.

$ cd /usr/share
$ sudo git clone --branch master https://github.com/drush-ops/drush.git

Install Drush

From the drush root directory, run composer to fetch the required dependencies.

$ cd /usr/share/drush
$ sudo composer install

Accessing Drush from anywhere on your system.

Create a symbolic link to the Drush executable in a directory that is already in your PATH.

$ ln -s /usr/share/drush/drush /usr/bin/drush

Download Drupal

At the time of writing this blog post the latest release of Drupal is 8.0.0-beta3. In order to download Drupal 8 we will use drush dl command an alias for drush pm-download.

$ drush dl drupal-8.0.0-beta3
$ mv drupal-8.0.0-beta3 drupal8.dev

Install Drupal

Change to the directory where Drupal was downloaded by drush and use drush si command as an alias for drush site-install.

$ cd path/to/drupal8.dev/
$ drush si standard --db-url=mysql://root:root@127.0.0.1/drupal --site-name=drupal8.dev --account-name=admin --account-pass=admin --account-mail=jesus.olivas@ffwagency.com -y

Make sure you use your own user and database credentials when running drush si and never user root on production. In this example we are accepting any interaction - answering yes when passing -y argument.

As you can see, when using Drush the process is very similar to previous Drupal versions - drush dl & drush si.

Finally, if you want to access your Drupal 8 site using http://drupal8.dev you will have to:

Add a new host in your hosts file (‘/etc/hosts’ as I am using Mac OS X)

127.0.0.1 drupal8.dev

Add a new virtual host in our web server config. Apache, in my case.

<VirtualHost *:80>
   ServerAdmin jesus.olivas@ffwagency.com
   DocumentRoot "/path/to/drupal8.dev"
   ServerName drupal8.dev
   <Directory "/path/to/drupal8.dev">
       Options FollowSymLinks
       AllowOverride All
       Require all granted
   </Directory>
</VirtualHost>

References:

* Composer: A dependency manager for PHP - https://getcomposer.org/
* Drush GitHub repository - https://github.com/drush-ops/drush
* Drupal project page - https://www.drupal.org/project/drupal
* Detailed information about drush commands -http://www.drushcommands.com

Note:

If you want to try Drupal 8 now. without worrying about configuring your local environment you may use the following online services:

*https://insight.acquia.com/free?distro=drupal8
http://getpantheon.com/d8 
http://trydrupal8.com/ 
http://simplytest.me/

Have questions? You can catch me on Twitter @jmolivas. Stay tuned for more helpful posts on Drupal 8.

FFW Agency sponsors the Console project for developing in Drupal 8.  

Visit http://www.drupal.org/project/console to try it. Please feel free to submit issues and requests!