PHP致命错误:找不到类'Cart \ App'

时间:2017-10-20 05:13:43

标签: php slim shopping-cart

我正在关注codesource的Build a shopping cart,然后我收到错误:

PHP致命错误:第9行的G:\ PleskVhosts \ tohokiwatch.com \ httpdocs \ cart \ bootstrap \ app.php中找不到“Cart \ App”类

我正在使用GoDaddy来托管我的网站,这是我的代码:

app.php:

<?php

use Cart\App;

session_start();

require __DIR__ . '/../vendor/autoload.php';

$app = new App;

require __DIR__ . '/../app/routes.php';

?>

App.php:

<?php

namespace Cart;

use DI\ContainerBuilder;
use DI\Bridge\Slim\App as DiBridge;

class App extends DIBridge
{
	protected function configureContainer(ContainerBuilder $builder)
	{
		$builder->addDefinitions([
			'settings.displayErrorDetails' => true,
		]);
	}
}

?>

的index.php:

<?php

require __DIR__ . '/../bootstrap/app.php';

$app->run();

?>

composer.json:

{
    "require": {
        "slim/slim": "^3.0",
        "slim/twig-view": "^2.3",
        "php-di/slim-bridge": "^1.0",
        "illuminate/database": "^5.5"
    },
	"autoload":{
		"psr-4":{
			"cart\\":"app"
		}
	}
}

我的GoDaddy文件目录: File Directory

0 个答案:

没有答案