diff --git a/core/modules/system/lib/Drupal/system/Controller/SystemInfoController.php b/core/modules/system/lib/Drupal/system/Controller/SystemInfoController.php
new file mode 100644
index 0000000..7360769
--- /dev/null
+++ b/core/modules/system/lib/Drupal/system/Controller/SystemInfoController.php
@@ -0,0 +1,31 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\system\Controller\SystemInfoController.
+ */
+
+namespace Drupal\system\Controller;
+
+use Symfony\Component\HttpFoundation\Response;
+
+/**
+ * Returns responses for System routes.
+ */
+class SystemInfoController {
+
+  /**
+   * Returns the contents of phpinfo().
+   *
+   * @return \Symfony\Component\HttpFoundation\Response
+   *   A response object to be sent to the client.
+   */
+  public function php() {
+    ob_start();
+    phpinfo();
+    $output = ob_get_contents();
+    ob_end_clean();
+    return new Response($output);
+  }
+
+}
diff --git a/core/modules/system/system.admin.inc b/core/modules/system/system.admin.inc
index d344d37..9641820 100644
--- a/core/modules/system/system.admin.inc
+++ b/core/modules/system/system.admin.inc
@@ -1459,14 +1459,6 @@ function system_run_cron() {
 }
 
 /**
- * Menu callback: return information about PHP.
- */
-function system_php() {
-  phpinfo();
-  drupal_exit();
-}
-
-/**
  * Default page callback for batches.
  */
 function system_batch_page() {
diff --git a/core/modules/system/system.module b/core/modules/system/system.module
index 4d2f61e..dfad161 100644
--- a/core/modules/system/system.module
+++ b/core/modules/system/system.module
@@ -1006,12 +1006,9 @@ function system_menu() {
     'type' => MENU_CALLBACK,
     'file' => 'system.admin.inc',
   );
-  $items['admin/reports/status/php'] = array(
+  $items['admin/reports/system/php'] = array(
     'title' => 'PHP',
-    'page callback' => 'system_php',
-    'access arguments' => array('administer site configuration'),
-    'type' => MENU_CALLBACK,
-    'file' => 'system.admin.inc',
+    'route_name' => 'system_php',
   );
 
   // Default page for batch operations.
diff --git a/core/modules/system/system.routing.yml b/core/modules/system/system.routing.yml
index b285844..19b9fd8 100644
--- a/core/modules/system/system.routing.yml
+++ b/core/modules/system/system.routing.yml
@@ -73,3 +73,10 @@ system_site_maintenance_mode:
     _form: 'Drupal\system\Form\SiteMaintenanceModeForm'
   requirements:
     _permission: 'administer site configuration'
+
+system_php:
+  pattern: '/admin/reports/status/php'
+  defaults:
+    _controller: 'Drupal\system\Controller\SystemInfoController::php'
+  requirements:
+    _permission: 'administer site configuration'
