今天我把我的symfony 2.6项目从我的本地windows机器放到我的linux webserver
当我访问我的网站时,它会按预期提示登录页面。我使用相同的用户凭据登录我如何在本地登录。我有一个用户和一个角色表。成功登录后,出现以下错误提示:
执行' SELECT t0.id AS id1,t0.name AS name2,t0.color AS color3 FROM employee t0': SQLSTATE [42S02]:未找到基表或视图:1146表' dzqoqnoa_cms.employee'不存在
我查了谷歌,但我发现只有小写问题。
我的实体:
namespace WO\OrganizerBundle\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
/**
* Employee
*
* @ORM\Table(name="employee")
* @ORM\Entity(repositoryClass="WO\OrganizerBundle\Entity\EmployeeRepository")
*/
class Employee
{
/**
* @var integer
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="name", type="string", length=255)
*/.............
我的控制器:
$em = $this->getDoctrine()->getManager();
$employees = $em->getRepository('WOOrganizerBundle:Employee')->findAll();
我的数据库:
我已使用以下命令清除所有缓存:
php app/console doctrine:cache:clear-metadata
php app/console doctrine:cache:clear-query
php app/console doctrine:cache:clear-result
rm -rf app/cache/
黑客是哪里的问题??
修改
以下是我的配置文件:
config.yml
imports:
- { resource: parameters.yml }
- { resource: security.yml }
- { resource: services.yml }
framework:
#esi: ~
#translator: { fallbacks: ["%locale%"] }
secret: "%secret%"
router:
resource: "%kernel.root_dir%/config/routing.yml"
strict_requirements: ~
form: ~
csrf_protection: ~
validation: { enable_annotations: true }
templating:
engines: ['twig']
#assets_version: SomeVersionScheme
default_locale: "%locale%"
trusted_hosts: ~
trusted_proxies: ~
session:
# handler_id set to null will use default session handler from php.ini
handler_id: ~
fragments: ~
http_method_override: true
# Twig Configuration
twig:
debug: "%kernel.debug%"
strict_variables: "%kernel.debug%"
# Assetic Configuration
assetic:
debug: "%kernel.debug%"
use_controller: false
bundles: [ ]
#java: /usr/bin/java
filters:
cssrewrite: ~
#closure:
# jar: "%kernel.root_dir%/Resources/java/compiler.jar"
#yui_css:
# jar: "%kernel.root_dir%/Resources/java/yuicompressor-2.4.7.jar"
# Doctrine Configuration
doctrine:
dbal:
driver: "%database_driver%"
host: "%database_host%"
port: "%database_port%"
dbname: "%database_name%"
user: "%database_user%"
password: "%database_password%"
charset: UTF8
# if using pdo_sqlite as your database driver:
# 1. add the path in parameters.yml
# e.g. database_path: "%kernel.root_dir%/data/data.db3"
# 2. Uncomment database_path in parameters.yml.dist
# 3. Uncomment next line:
# path: "%database_path%"
orm:
auto_generate_proxy_classes: "%kernel.debug%"
auto_mapping: true
# Swiftmailer Configuration
swiftmailer:
transport: "%mailer_transport%"
host: "%mailer_host%"
username: "%mailer_user%"
password: "%mailer_password%"
spool: { type: memory }
config_prod.yml
imports:
- { resource: config.yml }
monolog:
handlers:
main:
type: fingers_crossed
action_level: error
handler: nested
nested:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug
console:
type: console
现在我将所有内容从小写(员工)重命名为大写(Employee),但没有任何改变!
答案 0 :(得分:0)
您的Linux服务器区分大小写,因此解决方案是使用
更改您的表名称RENAME TABLE tbl_name TO new_tbl_name;
从员工到员工 例如 RENAME TABLE员工到员工。如果还有其他申请也。
答案 1 :(得分:0)
我的服务器提供商将我的项目目录更改为另一台服务器,所以我可以使用PHP 5.5.2但我没有通知它。所以我的ssh地址发生了变化,并且没有在新的ftp地址中检查dns。
现在一切都像预期的那样。