第646行的vendor / doctrine / dbal / lib / Doctrine / DBAL / Connection.php

时间:2014-12-01 06:03:43

标签: symfony doctrine-orm cpanel

在cpanel主机中上传symfony2项目之后:

执行

时发生异常
SELECT COUNT(*) AS dctrn_count FROM (SELECT DISTINCT id0 FROM (SELECT n0_.id AS id0, n0_.type AS type1, n0_.annoDate AS annoDate2, n0_.solarDate AS solarDate3, n0_.title AS title4, n0_.body AS body5, n0_.bodyMore AS bodyMore6, n0_.fileName AS fileName7, n0_.user_username AS user_username8 FROM NewsOrNotification n0_ WHERE n0_.type = 1 ORDER BY n0_.annoDate DESC) dctrn_result) dctrn_table:

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'darspard_h4mit.NewsOrNotification' doesn't exist 

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'darspard_h4mit.User' doesn't exist 

 in .../vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php at line 646  -+
                    $stmt->execute($params);
                }
            } else {
                $stmt = $this->_conn->query($query);
            }
        } catch (\Exception $ex) {
            throw DBALException::driverExceptionDuringQuery($ex, $query, $this->resolveParams($params, $types));

2 个答案:

答案 0 :(得分:0)

运行php app/console doctrine:schema:update --force。如果您无法访问控制台,请上传"准备就绪并清理"在您的开发环境中生成的数据库

答案 1 :(得分:0)

我在Windows操作系统上的开发环境不区分大小写,但Linux服务器区分大小写。结果,重命名的表具有相同的名称,实体和我的问题得到了解决。例如:

表newsornotification更改名称为NewsOrNotification