Akismet Can't Connect to Server

Posted September 9, 2014 14.3k views

Akismet is reporting “We can’t connect to your site. Your firewall may be blocking us. Please contact your host and refer to our guide about firewalls.” This started a couple weeks ago.

When I type sudo ufw status, it says sudo: ufw: command not found.

When I type iptables -L, it says

Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

which I guess means I don’t have any rules. Akismet says in their docs that they need a TCP connection. I don’t know how to give them that. I also don’t know what changed two weeks ago as it was working fine before that.

What else can I check? Is there a way to ping Akismet through TCP to make sure that’s the issue?

Ubuntu 12.10, Wordpress 4.0, Akismet 3.02


  • Check your php and make sure allow_url_fopen hasnt been disabled. Also if you have any sort of plugin (or in htaccess) that turns your site off line, make sure your site is accessible to the public. I ran into that with jetpack with a site offline plugin.

  • Thanks for the response. allow_url_fopen is set to On. I’m not sure what you mean by ‘turns your site off line’. The site is accessible normally, it’s just akismet that’s not working.

  • Pinging probably isnt going to do any good as that is over ICMP, not TCP. Akismet uses TCP port 80 for connections. If you have telnet on the server you may can try telnet 80 which will check your connection to them. If you have a text based browser (such as lynx, not sure what Ubuntu has available) you can probably try to access from it.

    On the php, I apologize but I think I told you wrong on that. It used to use allow_url_fopen but now it seems they use fsockopen and gethostbynamel now.

    I am not sure if this will help you or not but here is a page from akismet for connectivity problems…

    As far as the site offline thing, there are a few plugins that allow you to disable the site for maintenance or what ever. It can also be disabled by htaccess. If the site is disabled then it will have problems with communication which is why I mentioned that.

  • I actually noticed this as well on my server and it appears to have started right around the same time. I’m running CentOS, WordPress 3.9.2 and Akismet 3.01. Nothing’s changed on my server (to my knowledge) and calling wget <api_key> returns a 200 OK.

  • I don’t have either fsockopenor gethostbyname1inphp.ini. I tried to install telnet, but I can’t seem to install it, or update ubuntu, or install fix-missing. That’s another issue, but it would be nice.

    I read that akismet page, but it seems to focus on firewalls, which I don’t appear to have. That’s why I’m trying to focus on the tcp connection. If I don’t have a firewall, then digital ocean probably does right? Something has to be keeping the bad stuff out. I think it’s some upstream firewall that’s blocking it, but then every Wordpress site on DO would be having this problem.

    wgetreturns 200 for me, but I don’t know if that uses TCP or not.

  • Show 10 more comments

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
2 answers

Have you tried to check /etc/resolv.conf file configuration? It might be an issue with DNS servers and you can just get timeout for Akismet server.

  • nameserver
  • It is not going to be a resolv issue. If there was a problem with it then any outgoing connection that uses a domain instead of an IP address would fail. This includes the wget command that was issued, any outgoing mail, and trying to do updates on the server and any updates with the site, etc.. The wget command returning an OK result shows (see previous comments) that the server is able to communicate with akismet directly referencing the domain.

  • I just suggested to check those settings. I recently experienced some issues with response time and also had issues with Akismet at the same time. After the file I mentioned in my first reply was modified all response issues were fixed and I also noticed that Akismet started working again.

As currapps said, it is DNS issue .