<?php
use vendor\doctrine\common\lib\Doctrine\Common\ClassLoader,
vendor\doctrine\orm\lib\Doctrine\ORM\EntityManager;
require 'vendor/doctrine/common/lib/Doctrine/Common/ClassLoader.php' or die();
$loader = new ClassLoader("Doctrine");
$loader->register();
$dbParams = array(
'driver' => 'pdo_mysql',
'user' => 'root',
'password' => 'password',
'dbname' => 'test_doctrine'
);
$path = 'entities/';
$config = Setup::createAnnotationMetadataConfiguration($path, true);
$entityManager = EntityManager::create($dbParams, $config);
$user=new User();
$post=new Post($user);
$post->addComment("First comment");
$post->addComment("Seconde comment");
$entityManager->persist($user);
$entityManager->persist($post);
$entityManager->flush();
?>
我收到此错误:
警告:require(1):打开流失败:第 8 行的 /var/www/tests/index.php 中没有这样的文件或目录
致命错误:require():在 /var/www/tests/ 中打开所需的 '1' (include_path='.:/usr/share/php:/usr/local/lib/smarty-3.1.13/libs') 失败第 8 行的 index.php
有人可以帮我理解这里有什么问题吗?