Apache和PHP-我的服务器返回了空响应,而没有告诉我原因

 收藏

我整天都在头,似乎无法弄清楚这一点。

我有以下代码:

public function getUsers()
    {
        $company_id = 21;
        $users = User::with('user_details',
            'user_details.department',
            'user_details.payroll_group',
            'user_details.shift_group',
            'user_details.updated_by')
            ->with('deductions')
            ->with('allowances')
            // ->with('shifts')
            ->where('company_id', $company_id)
            ->get();

        foreach ($users as $key => $user) {
            $user->getFirstMedia('images');

            if(isset($user->media[0])){

                $users[$key]->media[0]->url = $user->media[0]->getFullUrl();
            }

            $users[$key]['user_salary'] = UserSalary::getCurrentRate($user->id);
        }

        return response()->json($users, 200);
    }

It seems that everytime that $company_id has a value of 21 my server always response is empty. BUT if not, it returns as what I've expected.

我在邮递员中尝试过,结果是:

enter image description here

I also tried running curl in my server, it responds this one:

curl: (52) Empty reply from server

I've checked laravel.log, there's no error. I've checked /var/log/apache2/error.log, there's no error also.

我没有解决该问题的想法。

请帮帮我!谢谢。

PS:我不知道我应该在这里还是在ServerFault上发布此文件,但是就可以了。

回复