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.
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 Desktop, MAMP or php-osx
* Windows: XAMPP, WAMP 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
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
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
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
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:email@example.com/drupal --site-name=drupal8.dev --account-name=admin --account-pass=admin --firstname.lastname@example.org -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)
Add a new virtual host in our web server config. Apache, in my case.
Require all granted
* 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
If you want to try Drupal 8 now. without worrying about configuring your local environment you may use the following online services:
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!