简体   繁体   中英

Symfony Virtual Server Amazon Ubuntu

I have project Symfony in local and hosting heroku. Yesterday I deploy in Virtual Server Amazon, Ubunut 14.04. I check for all problem for symfony (check.php):

this is

in Virtual Server Ubuntu and clone project, config vhost. And when I doing regisrtation company and , in local and another hosting work good, and when I want to enter in my credenials

http://artelfreelancedb/app_dev.php/auth/login_check

I have:

ContextErrorException: Notice: serialize(): "id" returned as member variable from __sleep() but does not exist in /var/www/artel-freelancedb/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Authentication/Token/AbstractToken.php line 160

What Iam doing wrong? In local work in fortrabit work in heroku work

I try in my entity fields protected but still problem. In auth action must be email and password credentials (In Entity SUser) (I try protected bit no)

<?php
namespace Artel\CustomerBundle\Entity;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;

/**
* Users
*
* @ORM\Table(name="users")
*      @ORM\Entity(repositoryClass="Artel\CustomerBundle\Entity\Repository\UsersR    epository")
*/

class Users extends SUser
{
/**
 * @var string
 *
 * @ORM\Column(name="web_site", type="string", length=255, nullable=true)
 */
private $webSite;

/**
 * @var integer
 *
 * @ORM\Column(name="employees", type="integer", nullable=true)
 */
private $employees;

/**
 * @var string
 *
 * @ORM\Column(name="markets", type="array", nullable=true)
 */
private $markets = array();

/**
 * @var string
 *
 * @ORM\Column(name="technologies", type="array", nullable=true)
 */
private $technologies = array();

/**
 * @var string
 *
 * @ORM\Column(name="zip", type="string", length=40, nullable=true)
 */
private $zip;

/**
 * @var \Cities
 *
 * @ORM\ManyToOne(targetEntity="Cities")
 * @ORM\JoinColumn(name="city_id", referencedColumnName="id")
 */
private $city;

/**
 * @var string
 *
 * @ORM\Column(name="address", type="string", length=255, nullable=true)
 */
private $address;

/**
 * @var string
 *
 * @ORM\Column(name="otherCities", type="array", nullable=true)
 */
private $otherCities;

/**
 * @ORM\OneToMany(targetEntity="Artel\CustomerBundle\Entity\Feedback", mappedBy="user")
 */
protected $feedback;

Help please

I solved my problem, add this methos for my entity.

public function __sleep(){
return array('id', 'username', 'email');
}

But Im not understand why in local work fine and heroku and fortrabit but in Virtual server have this trable ???

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM