Drupal: Cài đặt Drupal 8 trên Acquia Cloud

Các khóa học qua video:
Python SQL Server PHP C# Lập trình C Java HTML5-CSS3-JavaScript
Học trên YouTube <76K/tháng. Đăng ký Hội viên
Viết nhanh hơn - Học tốt hơn
Giải phóng thời gian, khai phóng năng lực

Want to use the most awesome version of Drupal on the most awesome Drupal hosting? ;) This guide is for you!

Let's Get Started

Installing Drupal 8 on Acquia Cloud

First, head to www.acquia.com/acquia-cloud-free to set up your new site. This process takes a few minutes, but worry not; you can bide your time watching helpful tutorial videos! Once your site is provisioned, you'll be taken to the Acquia Cloud workflow page.

Upgrade PHP version (important!)

Upgrade PHP version

Drupal 8 requires at least PHP 5.4 in order to install, so the first order of business is switching your environments' PHP versions, which you can easily do from the Workflow page.

  • Click on the triangle at the right of your Dev environment block
  • Click on Configure
  • Select PHP 5.5 and click Save
  • Repeat the same steps for your all environments.

See Configuring PHP Settings for more information.

Add SSH keys

Add SSH key to Acquia Cloud

  • Go to Cloud > Users and keys and click Add SSH key
  • Give it a name, and paste in your public key file's contents.
  • If you have no idea what that is ;) follow the instructions at either Mac and Unix or Windows.

Add Drupal 8 Files to Git

Git URL information

  • Click the Git URL box in the top-right corner of the Workflow page to view a pop-up with your subscription's Git information. Your Git URL should be somethinglike: webchickd8test@svn-3312.devcloud.hosting.acquia.com:webchickd8test.git
  • Clone your Git repository to your local computer following the instructions in the pop-up. This command should be something like: git clone webchickd8test@svn-3312.devcloud.hosting.acquia.com:webchickd8test.git d8
  • Download the latest release of Drupal 8 from https://drupal.org/node/3060/release?api_version%5B%5D=7234: wget http://ftp.drupal.org/files/projects/drupal-8.0-alpha12.tar.gz # Substitute latest version.
  • Extract it to the Git clone of your site's "docroot" folder: tar --strip-components=1 -zxvf drupal-8.0-alpha12.tar.gz -C d8/docroot

When finished, your Git repository's directory structure should look something like this:

Drupal 8's files nested inside the docroot folder.

  • Now, add the new files to your site's Git repo: cd d8 git add .
  • Finally, commit/push the changes to get the D8 files onto your dev server: git commit -m "Initial commit: Add all the D8 code files." git push origin master

Adding and configuring settings.php

Acquia Cloud-specific snippet to copy and paste into settings.php

You're just about ready to go! One last thing: we need to set up settings.php, specifically for Acquia Cloud's fancy-schmancy security (that's the technical term).

  • First, create your settings.php file from default.settings.php: cd docroot cp sites/default/default.settings.php sites/default/settings.php
  • Next, go to Cloud > Databases, and click the "Configure settings.php" button. It should show you some code like: if (file_exists('/var/www/site-php')) { require '/var/www/site-php/webchickd8test/webchickd8test-settings.inc'; }
  • Copy the include code, edit settings.php and add it to the end of the file.
  • Finally, add and push the settings file into Git: git add sites/default/settings.php git commit -am "Adding settings.php." git push origin master

Install away

First page of D8 installer

Now you're ready to Install Drupal 8 by going to http://SITENAMEdev.devcloud.acquia-sites.com/core/install.php (NOTE: you need to go directly to the install.php script; navigating to the home page instead will give you errors).

Get updates

Receive the best content about the future of marketing, industry shifts, and other thought leadership.

 

When I visit my new Drupal 8 Acquia site in order to set it up, I just get a blank white screen (also known as White Screen of Death (WSOD)). Help!

Generally, this occurs because PHP hit an error it could not recover from. First, figure out what happened. Navigate to Cloud > Logs and download the PHP log for the environment that's getting the blank page (for example, "Dev environment"). This will give you a file called php-errors.log. Open this file in a text editor or error console, as picrtured above. (For more help on this topic, see About Acquia Cloud logging.)

Syntax error in a core file? Make sure your PHP version is updated.

If you see an error like "PHP Parse error: syntax error, unexpected '[' in /mnt/www/html/[USERNAME]/docroot/core/vendor/guzzlehttp/guzzle/src/functions.php on line 20" the most likely culprit is your environment is still on PHP 5.3, versus PHP 5.5. To resolve this problem, follow instructions under "FIrst: Upgrade PHP." Then, manually go to the http://[YOUR_SITE]/install.php URL. Remember: the PHP version must be set per-environment.

That didn't fix it / It was some other weird PHP error.

This can also happen due to stale files in the compiled PHP directory (new to Drupal 8). Try following the troubleshooting tips at https://drupal.org/documentation/rebuild.

When I visit my new Drupal 8 Acquia site in order to set it up, I get an "Additional uncaught exception thrown while handling exception." error. Help!

If you see errors on the home page to the effect of "Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'webchickd8testdev.url_alias' doesn't exist: SELECT source FROM {url_alias} WHERE alias = :alias AND langcode IN (:langcode, :langcode_undetermined) ORDER BY langcode ASC, pid DESC; Array ( [:alias] => user [:langcode] => en [:langcode_undetermined] => und ) in Drupal\Core\Database\Connection->query() (line 569 of/mnt/www/html/webchickd8testdev/docroot/core/lib/Drupal/Core/Database/Connection.php).", this is caused by the settings.php tweak that pulls in Acquia Cloud's database info. It's complaining that tables don't exist because you haven't yet installed Drupal. Don't be alarmed! Simply navigate directly to http://[YOUR_SITE]/install.php instead.

The installation went fine, but now I get "If you have just changed code (for example deployed a new module or moved an existing one) read http://drupal.org/documentation/rebuild" on a blank white page. Help!

It sounds odd, but try running through the update.php process at [YOUR_SITE]/update.php. It should clear various caches and get you back up and running with your new D8 site!

Congratulations

After finished install Application, you must configuration Drupal site by click the button:

Result:

Viewing a PHP error log from Acquia Cloud.

» Tiếp: Cách cài đặt drush
« Trước: Hướng dẫn cài đặt theme, module trong site Drupal
Các khóa học qua video:
Python SQL Server PHP C# Lập trình C Java HTML5-CSS3-JavaScript
Học trên YouTube <76K/tháng. Đăng ký Hội viên
Viết nhanh hơn - Học tốt hơn
Giải phóng thời gian, khai phóng năng lực
Copied !!!