11

I keep getting this error:

No data received
Unable to load the webpage because the server sent no data.
Here are some suggestions:
Reload this webpage later.
Error 324 (net::ERR_EMPTY_RESPONSE): The server closed the connection without sending any data.

I know it's part of my script, but I don't know which part. It divides certain text into a few different files, and those files are being created, but it's also supposed to zip them, but it's not getting to that part, so I have a vague idea of the general area the problem is occurring. I know this entire question is lacking detail, but I'm hoping that someone who has more experience with PHP and who may have seen the error before would be able to tell me what's happening.

http://gyazo.com/12ba55613011a115bb7507040f4d3ddf

EDIT: It works on Firefox... How can it be different between browsers if it's server-side script?

mowwwalker
  • 16,634
  • 25
  • 104
  • 157

6 Answers6

8

Restart apache and mysql

service httpd restart

service mysqld restart

Hopefully this answer helps someone.

Community
  • 1
  • 1
Jtek Grafix
  • 136
  • 1
  • 2
  • I was stuck for a couple of hours on this problem after deploying a PHP Symfony & Silex application. No errors, just empty responses. Hadn't wanted to restart apache as server has other live sites on it. After your answer I went for it and suddenly, everything is working!! Thanks and hope this works for other people too! – Maltronic Aug 15 '16 at 14:35
  • Thanks, solved my huge issue... the big question... why did this work, what was the real problem, we may never know. – gunslingor Oct 12 '19 at 15:37
6

It's a Chrome thing: http://www.google.com/support/forum/p/Chrome/thread?tid=7d50c093bd4f8f6c&hl=en

AlienWebguy
  • 76,997
  • 17
  • 122
  • 145
  • I only ever get it on my site on that one page though, and I KNOW the script isn't completing. – mowwwalker Aug 19 '11 at 22:43
  • Do you receive the issue in Firefox though – AlienWebguy Aug 19 '11 at 22:44
  • It's an issue where the browser hangs while trying to use sockets that have been idle too long. Some users reported they were able to fix the issue temporarily by viewing their desired page in an incognito window. – AlienWebguy Aug 19 '11 at 22:48
  • Is there any way around this on my side though? To get it so that it works no matter what? Do you know what's causing this? – mowwwalker Aug 19 '11 at 22:50
  • It seems to be linked to social media stuff. TCP servers long polling, etc. Do you have Twitter or Facebook code on your page? – AlienWebguy Aug 19 '11 at 22:53
  • Not even. Ha. I'm so far from that kind of thing. This is probably some really dumb error on my part. Thanks so much for all the help though – mowwwalker Aug 19 '11 at 22:54
3

I don't know if you've already solved this, if it's a different problem causing the same symptoms or whatever, but yesterday I noticed this same error on my development machine, running Apache+PHP+MySQL under Linux, when accessing my local phpMyAdmin:

http://localhost/phpMyAdmin

It was running fine until that day, and I realized that by the same time I changed some settings related to sessions in my php.ini.

The problem was caused by having session.save_handler set to user instead of files. So I switched back to

session.save_handler = files

and voilà... everything is working fine again.

Also be sure to have set the proper session.save_path. In my case, and probably in most Linux systems,

session.save_path = "/tmp"

Be sure to set the proper permissions to that directory, too. Mine is chmod'ed to 777.

Pere
  • 1,068
  • 12
  • 20
1

A little late to the draw here, but I received this error while working on a local copy of a php project (on Chrome), and although Firefox loaded some parts of the pages, it was still throwing similar errors.

The really weird part was that if I commented out includes or a few functions it would load partially.

I got around it by restarting the local server. I was using MAMP. You can tell for sure that this is the issue if you're running MAMP by going to the home page - it'll likely throw the same error.

Cameron Hurd
  • 4,836
  • 1
  • 22
  • 31
  • I can confirm that this must be a MAMP/WAMP thing. Lost most of my Saturday to it. Restarting the server fixed it... for now. – Ben Racicot Jan 23 '16 at 21:54
0
tail -f /opt/local/apache2/logs/error_log

(or wherever is your apache2 install..)

... Will likely help you to spot where the problem lies in your PHP script. At least it did for me when facing the same problem (No data received, whatever the browser).

eightyfive
  • 4,601
  • 3
  • 35
  • 44
0

I was getting this issue intermittently in Chrome. For me, reloading the page would get a successful (non-empty) response, but it would sometimes take up to 3 or 4 reloads of the page. To handle this, I added the $.when(), .done(), and .fail() jQuery functions to my AJAX request. If the request fell into the .fail() function, I ran the location.reload(); js command to get the page to reload. Otherwise, I called a function that did the rest of my page loading in the .done() function.

This has the potential to create an infinite loop with the page never receiving a successful AJAX response and continuing to reload forever. So only try out this method if this issue is intermittent. If you are unable to get a successful AJAX response at all, then this method will not work for you.