diff --git a/core/core.services.yml b/core/core.services.yml
index 021ac1a..f5c4267 100644
--- a/core/core.services.yml
+++ b/core/core.services.yml
@@ -55,7 +55,7 @@ services:
     arguments: ['@database', '@cache_tags.invalidator.checksum']
   cache.backend.apcu:
     class: Drupal\Core\Cache\ApcuBackendFactory
-    arguments: ['@app.root', '@cache_tags.invalidator.checksum']
+    arguments: ['@app.root', '@kernel', '@cache_tags.invalidator.checksum']
   cache.backend.php:
     class: Drupal\Core\Cache\PhpBackendFactory
     arguments: ['@cache_tags.invalidator.checksum']
diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc
index fee191a..ea6e274 100644
--- a/core/includes/bootstrap.inc
+++ b/core/includes/bootstrap.inc
@@ -137,47 +137,6 @@
 define('DRUPAL_ROOT', dirname(dirname(__DIR__)));
 
 /**
- * Returns the appropriate configuration directory.
- *
- * @param bool $require_settings
- *   Only configuration directories with an existing settings.php file
- *   will be recognized. Defaults to TRUE. During initial installation,
- *   this is set to FALSE so that Drupal can detect a matching directory,
- *   then create a new settings.php file in it.
- * @param bool $reset
- *   Force a full search for matching directories even if one had been
- *   found previously. Defaults to FALSE.
- * @param \Symfony\Component\HttpFoundation\Request $request
- *   (optional) The current request. Defaults to \Drupal::request() or a new
- *   request created from globals.
- *
- * @return string
- *   The path of the matching directory.@see default.settings.php
- *
- * @deprecated in Drupal 8.x-dev, will be removed before Drupal 8.0.
- *   Use \Drupal\Core\DrupalKernel::getSitePath() instead. If the kernel is
- *   unavailable or the site path needs to be recalculated then
- *   Drupal\Core\DrupalKernel::findSitePath() can be used.
- */
-function conf_path($require_settings = TRUE, $reset = FALSE, Request $request = NULL) {
-  if (!isset($request)) {
-    if (\Drupal::hasRequest()) {
-      $request = \Drupal::request();
-    }
-    // @todo Remove once external CLI scripts (Drush) are updated.
-    else {
-      $request = Request::createFromGlobals();
-    }
-  }
-  if (\Drupal::hasService('kernel')) {
-    $site_path = \Drupal::service('kernel')->getSitePath();
-  }
-  if (!isset($site_path) || empty($site_path)) {
-    $site_path = DrupalKernel::findSitePath($request, $require_settings);
-  }
-  return $site_path;
-}
-/**
  * Returns the path of a configuration directory.
  *
  * @param string $type
diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc
index f98c64d..092977a 100644
--- a/core/includes/install.core.inc
+++ b/core/includes/install.core.inc
@@ -355,7 +355,7 @@ function install_begin_request($class_loader, &$install_state) {
 
   // Determine whether base system services are ready to operate.
   $install_state['config_verified'] = install_ensure_config_directory(CONFIG_ACTIVE_DIRECTORY) && install_ensure_config_directory(CONFIG_STAGING_DIRECTORY);
-  $install_state['database_verified'] = install_verify_database_settings();
+  $install_state['database_verified'] = install_verify_database_settings($site_path);
   $install_state['settings_verified'] = $install_state['config_verified'] && $install_state['database_verified'];
 
   // Install factory tables only after checking the database.
@@ -1053,11 +1053,17 @@ function install_verify_completed_task() {
 
 /**
  * Verifies that settings.php specifies a valid database connection.
+ *
+ * @param string $site_path
+ *  The site path.
+ *
+ * @return bool
+ *  TRUE if there are no database errors.
  */
-function install_verify_database_settings() {
+function install_verify_database_settings($site_path) {
   if ($database = Database::getConnectionInfo()) {
     $database = $database['default'];
-    $settings_file = './' . conf_path(FALSE) . '/settings.php';
+    $settings_file = './' . $site_path . '/settings.php';
     $errors = install_database_errors($database, $settings_file);
     if (empty($errors)) {
       return TRUE;
@@ -1872,8 +1878,9 @@ function install_check_translations($langcode, $server_pattern) {
   $readable = FALSE;
   $writable = FALSE;
   // @todo: Make this configurable.
-  $files_directory = conf_path() . '/files';
-  $translations_directory = conf_path() . '/files/translations';
+  $conf_path = \Drupal::service('kernel')->getSitePath();
+  $files_directory =  $conf_path . '/files';
+  $translations_directory = $conf_path . '/files/translations';
   $translations_directory_exists = FALSE;
   $translation_available = FALSE;
   $online = FALSE;
@@ -2051,7 +2058,7 @@ function install_check_requirements($install_state) {
   foreach ($default_files as $default_file_info) {
     $readable = FALSE;
     $writable = FALSE;
-    $conf_path = './' . conf_path(FALSE);
+    $conf_path = './' . \Drupal::service('kernel')->getSitePath();
     $file = $conf_path . "/{$default_file_info['file']}";
     $default_file = "./sites/default/{$default_file_info['file_default']}";
     $exists = FALSE;
diff --git a/core/includes/install.inc b/core/includes/install.inc
index e247378..467e586 100644
--- a/core/includes/install.inc
+++ b/core/includes/install.inc
@@ -197,7 +197,7 @@ function drupal_get_database_types() {
  */
 function drupal_rewrite_settings($settings = array(), $settings_file = NULL) {
   if (!isset($settings_file)) {
-    $settings_file = conf_path(FALSE) . '/settings.php';
+    $settings_file = \Drupal::service('kernel')->getSitePath() . '/settings.php';
   }
   // Build list of setting names and insert the values into the global namespace.
   $variable_names = array();
@@ -470,13 +470,13 @@ function drupal_install_config_directories() {
   $config_directories_hash = Crypt::randomBytesBase64(55);
   if (empty($config_directories[CONFIG_ACTIVE_DIRECTORY])) {
     $settings['config_directories'][CONFIG_ACTIVE_DIRECTORY] = (object) [
-      'value' => conf_path() . '/files/config_' . $config_directories_hash . '/active',
+      'value' => \Drupal::service('kernel')->getSitePath() . '/files/config_' . $config_directories_hash . '/active',
       'required' => TRUE,
     ];
   }
   if (empty($config_directories[CONFIG_STAGING_DIRECTORY])) {
     $settings['config_directories'][CONFIG_STAGING_DIRECTORY] = (object) [
-      'value' => conf_path() . '/files/config_' . $config_directories_hash . '/staging',
+      'value' => \Drupal::service('kernel')->getSitePath() . '/files/config_' . $config_directories_hash . '/staging',
       'required' => TRUE,
     ];
   }
diff --git a/core/includes/update.inc b/core/includes/update.inc
index e6fe7fa..f9bc34c 100644
--- a/core/includes/update.inc
+++ b/core/includes/update.inc
@@ -73,7 +73,7 @@ function update_settings_file_requirements() {
   $requirements = array();
 
   // Check whether settings.php needs to be rewritten.
-  $settings_file = conf_path() . '/settings.php';
+  $settings_file = \Drupal::service('kernel')->getSitePath() . '/settings.php';
   $writable = drupal_verify_install_file($settings_file, FILE_EXIST | FILE_READABLE | FILE_WRITABLE);
   $requirements['settings file']['title'] = 'Settings file';
   if ($writable) {
diff --git a/core/lib/Drupal/Core/Cache/ApcuBackendFactory.php b/core/lib/Drupal/Core/Cache/ApcuBackendFactory.php
index bbc4e3d..c04c524 100644
--- a/core/lib/Drupal/Core/Cache/ApcuBackendFactory.php
+++ b/core/lib/Drupal/Core/Cache/ApcuBackendFactory.php
@@ -8,6 +8,7 @@
 namespace Drupal\Core\Cache;
 
 use \Drupal\Component\Utility\Crypt;
+use \Drupal\Core\DrupalKernelInterface;
 
 class ApcuBackendFactory implements CacheFactoryInterface {
 
@@ -19,6 +20,13 @@ class ApcuBackendFactory implements CacheFactoryInterface {
   protected $sitePrefix;
 
   /**
+   * The Drupal kernel.
+   *
+   * @var \Drupal\Core\DrupalKernelInterface
+   */
+  protected $kernel;
+
+  /**
    * The cache tags checksum provider.
    *
    * @var \Drupal\Core\Cache\CacheTagsChecksumInterface
@@ -30,11 +38,13 @@ class ApcuBackendFactory implements CacheFactoryInterface {
    *
    * @param string $root
    *   The app root.
+   * @param \Drupal\Core\DrupalKernelInterface $kernel
+   *   The Drupal kernel.
    * @param \Drupal\Core\Cache\CacheTagsChecksumInterface $checksum_provider
    *   The cache tags checksum provider.
    */
-  public function __construct($root, CacheTagsChecksumInterface $checksum_provider) {
-    $this->sitePrefix = Crypt::hashBase64($root . '/' . conf_path());
+  public function __construct($root, DrupalKernelInterface $kernel, CacheTagsChecksumInterface $checksum_provider) {
+    $this->sitePrefix = Crypt::hashBase64($root . '/' . $kernel->getSitePath());
     $this->checksumProvider = $checksum_provider;
   }
 
diff --git a/core/lib/Drupal/Core/Database/Driver/sqlite/Install/Tasks.php b/core/lib/Drupal/Core/Database/Driver/sqlite/Install/Tasks.php
index 97eab54..3321e6d 100644
--- a/core/lib/Drupal/Core/Database/Driver/sqlite/Install/Tasks.php
+++ b/core/lib/Drupal/Core/Database/Driver/sqlite/Install/Tasks.php
@@ -49,7 +49,7 @@ public function getFormOptions(array $database) {
     // Make the text more accurate for SQLite.
     $form['database']['#title'] = t('Database file');
     $form['database']['#description'] = t('The absolute path to the file where @drupal data will be stored. This must be writable by the web server and should exist outside of the web root.', array('@drupal' => drupal_install_profile_distribution_name()));
-    $default_database = conf_path(FALSE) . '/files/.ht.sqlite';
+    $default_database = \Drupal::service('kernel')->getSitePath() . '/files/.ht.sqlite';
     $form['database']['#default_value'] = empty($database['database']) ? $default_database : $database['database'];
     return $form;
   }
diff --git a/core/lib/Drupal/Core/Extension/ExtensionDiscovery.php b/core/lib/Drupal/Core/Extension/ExtensionDiscovery.php
index 4681977..02efe45 100644
--- a/core/lib/Drupal/Core/Extension/ExtensionDiscovery.php
+++ b/core/lib/Drupal/Core/Extension/ExtensionDiscovery.php
@@ -7,8 +7,10 @@
 
 namespace Drupal\Core\Extension;
 
+use Drupal\Core\DrupalKernel;
 use Drupal\Core\Extension\Discovery\RecursiveExtensionFilterIterator;
 use Drupal\Core\Site\Settings;
+use Symfony\Component\HttpFoundation\Request;
 
 /**
  * Discovers available extensions in the filesystem.
@@ -153,7 +155,12 @@ public function scan($type, $include_tests = NULL) {
     }
 
     // Search the site-specific directory.
-    $searchdirs[static::ORIGIN_SITE] = conf_path();
+    if (\Drupal::hasService('kernel')) {
+      $searchdirs[static::ORIGIN_SITE] = \Drupal::service('kernel')->getSitePath();
+    }
+    else {
+      $searchdirs[static::ORIGIN_SITE] = DrupalKernel::findSitePath(Request::createFromGlobals());
+    }
 
     // Unless an explicit value has been passed, manually check whether we are
     // in a test environment, in which case test extensions must be included.
diff --git a/core/lib/Drupal/Core/Installer/Form/SiteConfigureForm.php b/core/lib/Drupal/Core/Installer/Form/SiteConfigureForm.php
index 0354e25..4ec3749 100644
--- a/core/lib/Drupal/Core/Installer/Form/SiteConfigureForm.php
+++ b/core/lib/Drupal/Core/Installer/Form/SiteConfigureForm.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\Core\Installer\Form;
 
+use Drupal\Core\DrupalKernelInterface;
 use Drupal\Core\Extension\ModuleInstallerInterface;
 use Drupal\Core\Form\ConfigFormBase;
 use Drupal\Core\Form\FormStateInterface;
@@ -21,6 +22,13 @@
 class SiteConfigureForm extends ConfigFormBase {
 
   /**
+   * The Drupal kernel.
+   *
+   * @var \Drupal\Core\DrupalKernelInterface
+   */
+  protected $kernel;
+
+  /**
    * The user storage.
    *
    * @var \Drupal\user\UserStorageInterface
@@ -60,6 +68,8 @@ class SiteConfigureForm extends ConfigFormBase {
    *
    * @param string $root
    *   The app root.
+   * @param \Drupal\Core\DrupalKernelInterface $kernel
+   *   The Drupal kernel.
    * @param \Drupal\user\UserStorageInterface $user_storage
    *   The user storage.
    * @param \Drupal\Core\State\StateInterface $state
@@ -69,8 +79,9 @@ class SiteConfigureForm extends ConfigFormBase {
    * @param \Drupal\Core\Locale\CountryManagerInterface $country_manager
    *   The country manager.
    */
-  public function __construct($root, UserStorageInterface $user_storage, StateInterface $state, ModuleInstallerInterface $module_installer, CountryManagerInterface $country_manager) {
+  public function __construct($root, DrupalKernelInterface $kernel, UserStorageInterface $user_storage, StateInterface $state, ModuleInstallerInterface $module_installer, CountryManagerInterface $country_manager) {
     $this->root = $root;
+    $this->kernel = $kernel;
     $this->userStorage = $user_storage;
     $this->state = $state;
     $this->moduleInstaller = $module_installer;
@@ -83,6 +94,7 @@ public function __construct($root, UserStorageInterface $user_storage, StateInte
   public static function create(ContainerInterface $container) {
     return new static(
       $container->get('app.root'),
+      $container->get('kernel'),
       $container->get('entity.manager')->getStorage('user'),
       $container->get('state'),
       $container->get('module_installer'),
@@ -115,7 +127,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
     $form['#title'] = $this->t('Configure site');
 
     // Warn about settings.php permissions risk
-    $settings_dir = conf_path();
+    $settings_dir = $this->kernel->getSitePath();
     $settings_file = $settings_dir . '/settings.php';
     // Check that $_POST is empty so we only show this message when the form is
     // first displayed, not on the next page after it is submitted. (We do not
diff --git a/core/lib/Drupal/Core/Installer/Form/SiteSettingsForm.php b/core/lib/Drupal/Core/Installer/Form/SiteSettingsForm.php
index 8cf65c9..6b9ef2f 100644
--- a/core/lib/Drupal/Core/Installer/Form/SiteSettingsForm.php
+++ b/core/lib/Drupal/Core/Installer/Form/SiteSettingsForm.php
@@ -7,10 +7,12 @@
 
 namespace Drupal\Core\Installer\Form;
 
+use Drupal\Core\DrupalKernelInterface;
 use Drupal\Component\Utility\Crypt;
 use Drupal\Core\Database\Database;
 use Drupal\Core\Form\FormBase;
 use Drupal\Core\Form\FormStateInterface;
+use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
  * Provides a form to configure and rewrite settings.php.
@@ -18,6 +20,32 @@
 class SiteSettingsForm extends FormBase {
 
   /**
+   * The Drupal kernel.
+   *
+   * @var \Drupal\Core\DrupalKernelInterface
+   */
+  protected $kernel;
+
+  /**
+   * Constructs a new SiteSettingsForm.
+   *
+   * @param \Drupal\Core\DrupalKernelInterface $kernel
+   *   The Drupal kernel.
+   */
+  public function __construct(DrupalKernelInterface $kernel) {
+    $this->kernel = $kernel;
+  }
+
+  /**
+    * {@inheritdoc}
+    */
+  public static function create(ContainerInterface $container) {
+    return new static(
+      $container->get('kernel')
+    );
+  }
+
+  /**
    * {@inheritdoc}
    */
   public function getFormId() {
@@ -28,7 +56,7 @@ public function getFormId() {
    * {@inheritdoc}
    */
   public function buildForm(array $form, FormStateInterface $form_state) {
-    $conf_path = './' . conf_path(FALSE);
+    $conf_path = './' . $this->kernel->getSitePath();
     $settings_file = $conf_path . '/settings.php';
 
     $form['#title'] = $this->t('Database configuration');
diff --git a/core/lib/Drupal/Core/Site/Settings.php b/core/lib/Drupal/Core/Site/Settings.php
index 85810d6..28d696f 100644
--- a/core/lib/Drupal/Core/Site/Settings.php
+++ b/core/lib/Drupal/Core/Site/Settings.php
@@ -116,7 +116,6 @@ public static function initialize($app_root, $site_path, &$class_loader) {
     $config = array();
     $databases = array();
 
-    // Make conf_path() available as local variable in settings.php.
     if (is_readable($app_root . '/' . $site_path . '/settings.php')) {
       require $app_root . '/' . $site_path . '/settings.php';
     }
diff --git a/core/lib/Drupal/Core/StreamWrapper/PublicStream.php b/core/lib/Drupal/Core/StreamWrapper/PublicStream.php
index e2b78ec..0cb4b02 100644
--- a/core/lib/Drupal/Core/StreamWrapper/PublicStream.php
+++ b/core/lib/Drupal/Core/StreamWrapper/PublicStream.php
@@ -8,7 +8,9 @@
 namespace Drupal\Core\StreamWrapper;
 
 use Drupal\Component\Utility\UrlHelper;
+use Drupal\Core\DrupalKernel;
 use Drupal\Core\Site\Settings;
+use Symfony\Component\HttpFoundation\Request;
 
 /**
  * Defines a Drupal public (public://) stream wrapper class.
@@ -61,8 +63,13 @@ public function getExternalUrl() {
    *   The base path for public:// typically sites/default/files.
    */
   public static function basePath() {
-    $base_path = Settings::get('file_public_path', conf_path() . '/files');
-    return $base_path;
+    if (\Drupal::hasService('kernel')) {
+      $site_path = \Drupal::service('kernel')->getSitePath();
+    }
+    else {
+      $site_path = DrupalKernel::findSitePath(Request::createFromGlobals());
+    }
+    return Settings::get('file_public_path', $site_path . '/files');
   }
 
 }
diff --git a/core/modules/file/tests/file_test/src/StreamWrapper/DummyReadOnlyStreamWrapper.php b/core/modules/file/tests/file_test/src/StreamWrapper/DummyReadOnlyStreamWrapper.php
index 99cf3e8..5b1eff9 100644
--- a/core/modules/file/tests/file_test/src/StreamWrapper/DummyReadOnlyStreamWrapper.php
+++ b/core/modules/file/tests/file_test/src/StreamWrapper/DummyReadOnlyStreamWrapper.php
@@ -31,7 +31,7 @@ public function getDescription() {
   }
 
   function getDirectoryPath() {
-    return conf_path() . '/files';
+    return \Drupal::service('kernel')->getSitePath() . '/files';
   }
 
   /**
diff --git a/core/modules/file/tests/file_test/src/StreamWrapper/DummyStreamWrapper.php b/core/modules/file/tests/file_test/src/StreamWrapper/DummyStreamWrapper.php
index 2ed31d0..453d3f6 100644
--- a/core/modules/file/tests/file_test/src/StreamWrapper/DummyStreamWrapper.php
+++ b/core/modules/file/tests/file_test/src/StreamWrapper/DummyStreamWrapper.php
@@ -31,7 +31,7 @@ public function getDescription() {
   }
 
   function getDirectoryPath() {
-    return conf_path() . '/files';
+    return \Drupal::service('kernel')->getSitePath() . '/files';
   }
 
   /**
diff --git a/core/modules/locale/locale.install b/core/modules/locale/locale.install
index 81aadf5..bc29508 100644
--- a/core/modules/locale/locale.install
+++ b/core/modules/locale/locale.install
@@ -5,9 +5,11 @@
  * Install, update, and uninstall functions for the Locale module.
  */
 
+use Drupal\Core\DrupalKernel;
 use Drupal\Core\Url;
 use Drupal\Core\Language\Language;
 use Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationSelected;
+use Symfony\Component\HttpFoundation\Request;
 
 /**
  * Implements hook_install().
@@ -15,7 +17,9 @@
 function locale_install() {
   // Create the interface translations directory and ensure it's writable.
   if (!$directory = \Drupal::config('locale.settings')->get('translation.path')) {
-    $directory = conf_path() . '/files/translations';
+    $request = Request::createFromGlobals();
+    $conf_path = DrupalKernel::findSitePath($request);
+    $directory = $conf_path . '/files/translations';
     \Drupal::configFactory()->getEditable('locale.settings')->set('translation.path', $directory)->save();
   }
   file_prepare_directory($directory, FILE_CREATE_DIRECTORY | FILE_MODIFY_PERMISSIONS);
diff --git a/core/modules/simpletest/src/TestBase.php b/core/modules/simpletest/src/TestBase.php
index 6ef3e94..cbe89e5 100644
--- a/core/modules/simpletest/src/TestBase.php
+++ b/core/modules/simpletest/src/TestBase.php
@@ -1119,7 +1119,8 @@ private function prepareEnvironment() {
     }
 
     // Backup current in-memory configuration.
-    $this->originalSite = conf_path();
+    $site_path = \Drupal::service('kernel')->getSitePath();
+    $this->originalSite = $site_path;
     $this->originalSettings = Settings::getAll();
     $this->originalConfig = $GLOBALS['config'];
     // @todo Remove all remnants of $GLOBALS['conf'].
@@ -1134,7 +1135,7 @@ private function prepareEnvironment() {
     // Save further contextual information.
     // Use the original files directory to avoid nesting it within an existing
     // simpletest directory if a test is executed within a test.
-    $this->originalFileDirectory = Settings::get('file_public_path', conf_path() . '/files');
+    $this->originalFileDirectory = Settings::get('file_public_path', $site_path . '/files');
     $this->originalProfile = drupal_get_profile();
     $this->originalUser = isset($user) ? clone $user : NULL;
 
@@ -1204,7 +1205,6 @@ private function prepareEnvironment() {
     // After preparing the environment and changing the database prefix, we are
     // in a valid test environment.
     drupal_valid_test_ua($this->databasePrefix);
-    conf_path(FALSE, TRUE);
 
     // Reset settings.
     new Settings(array(
@@ -1318,7 +1318,6 @@ private function restoreEnvironment() {
     else {
       drupal_valid_test_ua(FALSE);
     }
-    conf_path(TRUE, TRUE);
 
     // Restore original shutdown callbacks.
     $callbacks = &drupal_register_shutdown_function();
diff --git a/core/modules/simpletest/src/Tests/SimpleTestTest.php b/core/modules/simpletest/src/Tests/SimpleTestTest.php
index 92a4529..9a29228 100644
--- a/core/modules/simpletest/src/Tests/SimpleTestTest.php
+++ b/core/modules/simpletest/src/Tests/SimpleTestTest.php
@@ -161,6 +161,7 @@ function stubTest() {
     // @see drupal_generate_test_ua();
     $key_file = DRUPAL_ROOT . '/sites/simpletest/' . substr($this->databasePrefix, 10) . '/.htkey';
     $private_key = Crypt::randomBytesBase64(55);
+    $kernel = $this->container->get('kernel');
     file_put_contents($key_file, $private_key);
 
     // This causes the first of the fifteen passes asserted in
@@ -192,7 +193,7 @@ function stubTest() {
 
     // These cause the eleventh to fourteenth of the fifteen passes asserted in
     // confirmStubResults().
-    $this->assertTrue(file_exists(conf_path() . '/settings.testing.php'));
+    $this->assertTrue(file_exists($kernel->getSitePath() . '/settings.testing.php'));
     // Check the settings.testing.php file got included.
     $this->assertTrue(function_exists('simpletest_test_stub_settings_function'));
     // Check that the test-specific service file got loaded.
diff --git a/core/modules/system/src/Tests/File/DirectoryTest.php b/core/modules/system/src/Tests/File/DirectoryTest.php
index acbea60..a3c44d3 100644
--- a/core/modules/system/src/Tests/File/DirectoryTest.php
+++ b/core/modules/system/src/Tests/File/DirectoryTest.php
@@ -17,7 +17,8 @@ class DirectoryTest extends FileTestBase {
    * Test local directory handling functions.
    */
   function testFileCheckLocalDirectoryHandling() {
-    $directory = conf_path() . '/files';
+    $kernel = $this->container->get('kernel');
+    $directory = $kernel->getSitePath() . '/files';
 
     // Check a new recursively created local directory for correct file system
     // permissions.
diff --git a/core/modules/system/src/Tests/File/ReadOnlyStreamWrapperTest.php b/core/modules/system/src/Tests/File/ReadOnlyStreamWrapperTest.php
index 242a378..dd1a2b3 100644
--- a/core/modules/system/src/Tests/File/ReadOnlyStreamWrapperTest.php
+++ b/core/modules/system/src/Tests/File/ReadOnlyStreamWrapperTest.php
@@ -2,7 +2,7 @@
 
 /**
  * @file
- * Definition of Drupal\system\Tests\File\ReadOnlyStreamWrapperTest.
+ * Contains Drupal\system\Tests\File\ReadOnlyStreamWrapperTest.
  */
 
 namespace Drupal\system\Tests\File;
@@ -34,7 +34,8 @@ class ReadOnlyStreamWrapperTest extends FileTestBase {
   function testReadOnlyBehavior() {
     // Generate a test file
     $filename = $this->randomMachineName();
-    $filepath = conf_path() . '/files/' . $filename;
+    $kernel = $this->container->get('kernel');
+    $filepath = $kernel->getSitePath() . '/files/' . $filename;
     file_put_contents($filepath, $filename);
 
     // Generate a read-only stream wrapper instance
@@ -79,7 +80,7 @@ function testReadOnlyBehavior() {
 
     // Test the mkdir() function by attempting to create a directory.
     $dirname = $this->randomMachineName();
-    $dir = conf_path() . '/files/' . $dirname;
+    $dir = $kernel->getSitePath() . '/files/' . $dirname;
     $readonlydir = $this->scheme . '://' . $dirname;
     $this->assertFalse(@drupal_mkdir($readonlydir, 0775, 0), 'Unable to create directory with read-only stream wrapper.');
     // Create a temporary directory for testing purposes
diff --git a/core/modules/system/src/Tests/Installer/InstallerExistingSettingsTest.php b/core/modules/system/src/Tests/Installer/InstallerExistingSettingsTest.php
index 4645668..8125fd6 100644
--- a/core/modules/system/src/Tests/Installer/InstallerExistingSettingsTest.php
+++ b/core/modules/system/src/Tests/Installer/InstallerExistingSettingsTest.php
@@ -9,6 +9,8 @@
 
 use Drupal\simpletest\InstallerTestBase;
 use Drupal\Core\Database\Database;
+use Symfony\Component\HttpFoundation\Request;
+use Drupal\Core\DrupalKernel;
 
 /**
  * Tests the installer with an existing settings file.
@@ -41,14 +43,17 @@ protected function setUp() {
       'required' => TRUE,
     );
 
+    $request = Request::createFromGlobals();
+    $conf_path = DrupalKernel::findSitePath($request);
+
     // Pre-configure config directories.
     $this->settings['config_directories'] = array(
       CONFIG_ACTIVE_DIRECTORY => (object) array(
-        'value' => conf_path() . '/files/config_active',
+        'value' => $conf_path . '/files/config_active',
         'required' => TRUE,
       ),
       CONFIG_STAGING_DIRECTORY => (object) array(
-        'value' => conf_path() . '/files/config_staging',
+        'value' => $conf_path . '/files/config_staging',
         'required' => TRUE,
       ),
     );
diff --git a/core/modules/system/src/Tests/System/SettingsRewriteTest.php b/core/modules/system/src/Tests/System/SettingsRewriteTest.php
index 70b4043..b515a02 100644
--- a/core/modules/system/src/Tests/System/SettingsRewriteTest.php
+++ b/core/modules/system/src/Tests/System/SettingsRewriteTest.php
@@ -21,6 +21,7 @@ class SettingsRewriteTest extends KernelTestBase {
    */
   function testDrupalRewriteSettings() {
     include_once \Drupal::root() . '/core/includes/install.inc';
+    $kernel = $this->container->get('kernel');
     $tests = array(
       array(
         'original' => '$no_index_value_scalar = TRUE;',
@@ -99,7 +100,7 @@ function testDrupalRewriteSettings() {
       ),
     );
     foreach ($tests as $test) {
-      $filename = Settings::get('file_public_path', conf_path() . '/files') . '/mock_settings.php';
+      $filename = Settings::get('file_public_path', $kernel->getSitePath() . '/files') . '/mock_settings.php';
       file_put_contents(\Drupal::root() . '/' . $filename, "<?php\n" . $test['original'] . "\n");
       drupal_rewrite_settings($test['settings'], $filename);
       $this->assertEqual(file_get_contents(\Drupal::root() . '/' . $filename), "<?php\n" . $test['expected'] . "\n");
@@ -117,7 +118,7 @@ function testDrupalRewriteSettings() {
       'expected' => '$no_index = true;'
     );
     // Make an empty file.
-    $filename = Settings::get('file_public_path', conf_path() . '/files') . '/mock_settings.php';
+    $filename = Settings::get('file_public_path', $kernel->getSitePath() . '/files') . '/mock_settings.php';
     file_put_contents(\Drupal::root() . '/' . $filename, "");
 
     // Write the setting to the file.
diff --git a/core/modules/system/system.install b/core/modules/system/system.install
index 4a8683e..993c655 100644
--- a/core/modules/system/system.install
+++ b/core/modules/system/system.install
@@ -10,10 +10,12 @@
 use Drupal\Component\Utility\SafeMarkup;
 use Drupal\Core\Url;
 use Drupal\Core\Database\Database;
+use Drupal\Core\DrupalKernel;
 use Drupal\Core\Language\Language;
 use Drupal\Core\Site\Settings;
 use Drupal\Core\StreamWrapper\PrivateStream;
 use Drupal\Core\StreamWrapper\PublicStream;
+use Symfony\Component\HttpFoundation\Request;
 
 /**
  * Implements hook_requirements().
@@ -235,7 +237,8 @@ function system_requirements($phase) {
   // Test configuration files and directory for writability.
   if ($phase == 'runtime') {
     $conf_errors = array();
-    $conf_path = conf_path();
+    $request = Request::createFromGlobals();
+    $conf_path = DrupalKernel::findSitePath($request);
     if (!drupal_verify_install_file($conf_path, FILE_NOT_WRITABLE, 'dir')) {
       $conf_errors[] = t("The directory %file is not protected from modifications and poses a security risk. You must change the directory's permissions to be non-writable.", array('%file' => $conf_path));
     }
@@ -376,7 +379,9 @@ function system_requirements($phase) {
     else {
       // If we are installing Drupal, the settings.php file might not exist yet
       // in the intended site directory, so don't require it.
-      $directories[] = conf_path(FALSE) . '/files';
+      $request = Request::createFromGlobals();
+      $conf_path = DrupalKernel::findSitePath($request);
+      $directories[] = $conf_path . '/files';
     }
     if ($file_private_path = Settings::get('file_private_path')) {
       $directories[] = $file_private_path;
@@ -403,7 +408,7 @@ function system_requirements($phase) {
     $requirements['config directories'] = array(
       'title' => t('Configuration directories'),
       'value' => t('Not present'),
-      'description' => t('Your %file file must define the $config_directories variable as an array containing the name of a directories in which configuration files can be written.', array('%file' => conf_path() . '/settings.php')),
+      'description' => t('Your %file file must define the $config_directories variable as an array containing the name of a directories in which configuration files can be written.', array('%file' => $conf_path . '/settings.php')),
       'severity' => REQUIREMENT_ERROR,
     );
   }
diff --git a/core/modules/update/src/Form/UpdateManagerInstall.php b/core/modules/update/src/Form/UpdateManagerInstall.php
index b3e2deb..6ec2753 100644
--- a/core/modules/update/src/Form/UpdateManagerInstall.php
+++ b/core/modules/update/src/Form/UpdateManagerInstall.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\update\Form;
 
+use Drupal\Core\DrupalKernelInterface;
 use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\FileTransfer\Local;
 use Drupal\Core\Form\FormBase;
@@ -34,16 +35,26 @@ class UpdateManagerInstall extends FormBase {
   protected $root;
 
   /**
+   * The Drupal kernel.
+   *
+   * @var \Drupal\Core\DrupalKernelInterface
+   */
+  protected $kernel;
+
+  /**
    * Constructs a new UpdateManagerInstall.
    *
    * @param string $root
    *   The app root.
    * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
    *   The module handler.
+   * @param \Drupal\Core\DrupalKernelInterface $kernel
+   *   The Drupal kernel.
    */
-  public function __construct($root, ModuleHandlerInterface $module_handler) {
+  public function __construct($root, ModuleHandlerInterface $module_handler, DrupalKernelInterface $kernel) {
     $this->root = $root;
     $this->moduleHandler = $module_handler;
+    $this->kernel = $kernel;
   }
 
   /**
@@ -59,7 +70,8 @@ public function getFormID() {
   public static function create(ContainerInterface $container) {
     return new static(
       $container->get('app.root'),
-      $container->get('module_handler')
+      $container->get('module_handler'),
+      $container->get('kernel')
     );
   }
 
@@ -216,7 +228,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
     // install the code, there's no need to prompt for FTP/SSH credentials.
     // Instead, we instantiate a Drupal\Core\FileTransfer\Local and invoke
     // update_authorize_run_install() directly.
-    if (fileowner($project_real_location) == fileowner(conf_path())) {
+    if (fileowner($project_real_location) == fileowner($this->kernel->getSitePath())) {
       $this->moduleHandler->loadInclude('update', 'inc', 'update.authorize');
       $filetransfer = new Local($this->root);
       call_user_func_array('update_authorize_run_install', array_merge(array($filetransfer), $arguments));
diff --git a/core/modules/update/src/Form/UpdateReady.php b/core/modules/update/src/Form/UpdateReady.php
index 8e106fe..03f6914 100644
--- a/core/modules/update/src/Form/UpdateReady.php
+++ b/core/modules/update/src/Form/UpdateReady.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\update\Form;
 
+use Drupal\Core\DrupalKernelInterface;
 use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\FileTransfer\Local;
 use Drupal\Core\Form\FormBase;
@@ -42,6 +43,13 @@ class UpdateReady extends FormBase {
   protected $state;
 
   /**
+   * The Drupal kernel.
+   *
+   * @var \Drupal\Core\DrupalKernelInterface
+   */
+   protected $kernel;
+
+  /**
    * Constructs a new UpdateReady object.
    *
    * @param string $root
@@ -50,11 +58,14 @@ class UpdateReady extends FormBase {
    *   The object that manages enabled modules in a Drupal installation.
    * @param \Drupal\Core\State\StateInterface $state
    *   The state key value store.
+   * @param \Drupal\Core\DrupalKernelInterface $kernel
+   *   The Drupal kernel.
    */
-  public function __construct($root, ModuleHandlerInterface $module_handler, StateInterface $state) {
-    $this->root = $root;
-    $this->moduleHandler = $module_handler;
-    $this->state = $state;
+  public function __construct($root, ModuleHandlerInterface $module_handler, StateInterface $state, DrupalKernelInterface $kernel) {
+     $this->root = $root;
+     $this->moduleHandler = $module_handler;
+     $this->state = $state;
+    $this->kernel = $kernel;
   }
 
   /**
@@ -71,7 +82,8 @@ public static function create(ContainerInterface $container) {
     return new static(
       $container->get('app.root'),
       $container->get('module_handler'),
-      $container->get('state')
+      $container->get('state'),
+      $container->get('kernel')
     );
   }
 
@@ -142,7 +154,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
       // trying to install the code, there's no need to prompt for FTP/SSH
       // credentials. Instead, we instantiate a Drupal\Core\FileTransfer\Local
       // and invoke update_authorize_run_update() directly.
-      if (fileowner($project_real_location) == fileowner(conf_path())) {
+      if (fileowner($project_real_location) == fileowner($this->kernel->getSitePath())) {
         $this->moduleHandler->loadInclude('update', 'inc', 'update.authorize');
         $filetransfer = new Local($this->root);
         update_authorize_run_update($filetransfer, $updates);
diff --git a/core/modules/update/update.manager.inc b/core/modules/update/update.manager.inc
index 13be6df..78eff8f 100644
--- a/core/modules/update/update.manager.inc
+++ b/core/modules/update/update.manager.inc
@@ -37,6 +37,8 @@
  */
 
 use Symfony\Component\HttpFoundation\RedirectResponse;
+use Symfony\Component\HttpFoundation\Request;
+use Drupal\Core\DrupalKernel;
 
 /**
  * Batch callback: Performs actions when the download batch is completed.
@@ -304,7 +306,9 @@ function update_manager_local_transfers_allowed() {
   // the configuration directory to determine if local transfers will be
   // allowed.
   $temporary_file = drupal_tempnam('temporary://', 'update_');
-  $local_transfers_allowed = fileowner($temporary_file) === fileowner(conf_path());
+  $request = Request::createFromGlobals();
+  $conf_path = DrupalKernel::findSitePath($request);
+  $local_transfers_allowed = fileowner($temporary_file) === fileowner($conf_path);
 
   // Clean up. If this fails, we can ignore it (since this is just a temporary
   // file anyway).
diff --git a/sites/default/default.settings.php b/sites/default/default.settings.php
index 8a3dfa4..4ca1c2c 100644
--- a/sites/default/default.settings.php
+++ b/sites/default/default.settings.php
@@ -48,7 +48,7 @@
  * sites/8080.www.drupal.org.mysite.test/.
  *
  * @see example.sites.php
- * @see conf_path()
+ * @see \Drupal\Core\DrupalKernel::getSitePath()
  *
  * In addition to customizing application settings through variables in
  * settings.php, you can create a services.yml file in the same directory to
