Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
index.php
Go to the documentation of this file.
1 <?php
8 
9 if (PHP_SAPI == 'cli') {
10  echo "You cannot run this from the command line." . PHP_EOL .
11  "Run \"php bin/magento\" instead." . PHP_EOL;
12  exit(1);
13 }
14 try {
15  require __DIR__ . '/../app/bootstrap.php';
16 } catch (\Exception $e) {
17  echo <<<HTML
18 <div style="font:12px/1.35em arial, helvetica, sans-serif;">
19  <div style="margin:0 0 25px 0; border-bottom:1px solid #ccc;">
20  <h3 style="margin:0;font-size:1.7em;font-weight:normal;text-transform:none;text-align:left;color:#2f2f2f;">
21  Autoload error</h3>
22  </div>
23  <p>{$e->getMessage()}</p>
24 </div>
25 HTML;
26  exit(1);
27 }
28 
29 // For Setup Wizard we are using our customized error handler
30 $handler = new \Magento\Framework\App\ErrorHandler();
31 set_error_handler([$handler, 'handler']);
32 
33 $configuration = require __DIR__ . '/config/application.config.php';
36 $application->getServiceManager()
37  ->get(ObjectManagerProvider::class)
38  ->setObjectManager(\Magento\Framework\App\Bootstrap::create(BP, $_SERVER)->getObjectManager());
39 $application->run();
$configuration
Definition: index.php:33
defined('TESTS_BP')||define('TESTS_BP' __DIR__
Definition: _bootstrap.php:60
$application
Definition: index.php:35
exit
Definition: redirect.phtml:12
const BP
Definition: autoload.php:14
catch(\Exception $e) $bootstrap
Definition: index.php:36
catch(\Exception $e) $handler
Definition: index.php:30