diff --git a/core/lib/Drupal/Component/PhpStorage/FileStorage.php b/core/lib/Drupal/Component/PhpStorage/FileStorage.php
index 1e6a2b3..bc30cad 100644
--- a/core/lib/Drupal/Component/PhpStorage/FileStorage.php
+++ b/core/lib/Drupal/Component/PhpStorage/FileStorage.php
@@ -159,7 +159,12 @@ protected function createDirectory($directory, $mode = 0777, $is_backwards_recur
     }
     // Otherwise, try to create the directory and ensure to set its permissions,
     // because mkdir() obeys the umask of the current process.
-    if (is_dir($parent = dirname($directory))) {
+    $parent = dirname($directory);
+    // Use readlink() to read the target of symbolic link.
+    if (is_link($directory)) {
+      $parent = readlink($parent);
+    }
+    if (is_dir($parent)) {
       // If the parent directory exists, then the backwards recursion must end,
       // regardless of whether the subdirectory could be created.
       if ($status = mkdir($directory)) {
