【问题标题】:PHP server exited signal: killedPHP服务器退出信号:被杀死
【发布时间】:2020-11-16 19:42:43
【问题描述】:

4.8 在我初始化日志记录协议之前,服务器运行良好。 很抱歉在下面发送了这么多信息,只是想确保大家了解上下文。

我在发送请求后收到此日志:

[Application    ] Jul 27 14:49:01 |INFO | SECURI User has been authenticated successfully. username="max.loua@nouvellesdonnes.com"
Shut down, bye!

该消息后跟一个

PHP server exited unexpectedly: signal:killed

我正在使用身份验证:

Symfony\Component\Security\Http\Authentication;

包含所有必需的组件(我的 IDE 会自动插入它们PHPStorm

security.yaml 文件是这样设置的,带有 default_target_path 选项。

security:
    encoders:
        App\Entity\User: bcrypt
    # https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers
    providers:
      database_users:
          entity: { class: App\Entity\User, property: email}

日志参数的默认路径:

form_login:
                check_path: security_login
                login_path: security_login
                default_target_path: theme_add

我的安全控制器中的基本登录功能:

public function login(AuthenticationUtils $authenticationUtils){
            return new Response($this->twig->render(
                'security/login.html.twig',
                [
                    'last_username' => $authenticationUtils->getLastUsername(),
                    'error' => $authenticationUtils->getLastAuthenticationError()
                ]
            ));
    }

用户显然已通过身份验证,浏览器等待,然后服务器突然关闭,我到处寻找在线问题,但没有。

我查看了我在 apache2 上的日志输出,并收到此错误 cat /var/log/apache2/error.log[mpm_prefork:notice] [pid 42135] AH00169: caught SIGTERM, shutting down

【问题讨论】:

    标签: php postgresql doctrine-orm apache2 symfony4


    【解决方案1】:

    经过 2 天的长时间在线查找并尝试解决问题,它来自我的实体(用户)中的一个函数,有问题的函数是 serialize()

    public function serialize()
        {
            return $this->serialize(array(
                $this->id,
                $this->last_name,
                $this->email,
                $this->job,
                $this->password,
                $this->username
            ));
        }
    

    函数循环导致$this-> 我所要做的就是删除它。

    【讨论】:

      猜你喜欢
      • 2023-03-03
      • 1970-01-01
      • 2017-11-20
      • 1970-01-01
      • 1970-01-01
      • 2021-07-31
      • 1970-01-01
      • 1970-01-01
      • 2016-08-30
      相关资源
      最近更新 更多