Symfony2 部署 [英] Symfony2 Deployment

查看:33
本文介绍了Symfony2 部署的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在我的 PC 上安装一个具有相同规格的 Symfony 项目,但每当我在开发环境中运行该应用程序时,它都会给我以下错误:

I'm currently installing a Symfony project on my PC having the same specifications yet it has been giving me the following error whenever I'm running the app in the dev environment:

由于系统问题,无法处理身份验证请求.

我认为只需清除缓存就可以解决所有问题.我什至尝试从此处执行可能解决问题的建议流程.然而它仍然是一样的.我已经清除了缓存(控制台和手动),通过运行以下命令创建了一个新用户:

I thought by just simply clearing the cache it would solve everything. I even tried to do the suggested process that might solve the problem from here. Yet it's still the same. I already cleared the cache(console and manual), created a new user by running this command:

php app\console fos:user:create testuser test@example.com p@ssw0rd

甚至这些:

php app\console science:schema:update --force

php app\console science:schema:update --dump-sql

你认为我还应该做什么?

What else do you think I should do?

附加组件

当我在 prod 环境中运行它时,我收到以下错误和警告:

When I run it with the prod environment, I receive the following errors and warnings:

警告:在 C:\xampp\htdocs\Tracker\vendor\doctrine\orm\lib\Doctrine\ORM\Mapping\ 中反序列化 'Matrix\MatrixUserBundle\Entity\User' 的错误数据格式ClassMetadataInfo.php 第 869 行

Warning: Erroneous data format for unserializing 'Matrix\MatrixUserBundle\Entity\User' in C:\xampp\htdocs\Tracker\vendor\doctrine\orm\lib\Doctrine\ORM\Mapping\ClassMetadataInfo.php on line 869

注意:unserialize():C:\xampp\htdocs\Tracker\vendor\doctrine\orm\lib\Doctrine\ORM\Mapping\ClassMetadataInfo.php 中 47 个字节的偏移量 46 处出错在线869

Notice: unserialize(): Error at offset 46 of 47 bytes in C:\xampp\htdocs\Tracker\vendor\doctrine\orm\lib\Doctrine\ORM\Mapping\ClassMetadataInfo.php on line 869

致命错误: __clone 方法在非对象上调用C:\xampp\htdocs\Tracker\vendor\doctrine\orm\lib\Doctrine\ORM\Mapping\ClassMetadataInfo.php在线 872

Fatal error: __clone method called on non-object in C:\xampp\htdocs\Tracker\vendor\doctrine\orm\lib\Doctrine\ORM\Mapping\ClassMetadataInfo.php on line 872

推荐答案

升级到 PHP 5.6 会破坏 unserialize 功能.我在 Symfony 中使用 JMSSerializerBundle 遇到了这个问题.它在 JMSSerializerBundle 的当前 master 中已修复,因此我通过将 composer.json 更改为使用来解决此问题

There is an issue where upgrading to PHP 5.6 breaks the unserialize function. I encountered this using the JMSSerializerBundle in Symfony. It is fixed in the current master of JMSSerializerBundle so I fixed this problem by changing composer.json to use

"jms/serializer-bundle": "dev-master"

可能是更新您的学说版本以在 composer.json 中使用 master,如下所述:

It may be that updating your doctrine version to use master in composer.json as mentioned here:

Symfony 2.5.3 和 PHP 5.6.0:不兼容问题?

这篇关于Symfony2 部署的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆