Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

484
Views
Apache and PHP - My server returns an empty response without telling me why

I've been banging my head all day and can't seem to figure this one out.

I have this code:

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.

I tried it in postman, this is the result:

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.

I ran out of ideas how to solve this one.

Help me, please! Thanks.

PS: I don't know if i should post this one here or at ServerFault, but here it goes.

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!