2

This is the error shown in reports/status.

Your system or network configuration does not allow Drupal to access web pages, resulting in reduced functionality. This could be due to your webserver configuration or PHP settings, and should be resolved in order to download information about available updates, fetch aggregator feeds, sign in via OpenID, or use other network-dependent services. If you are certain that Drupal can access web pages but you are still seeing this message, you may add $conf['drupal_http_request_fails'] = FALSE; to the bottom of your settings.php file.

What do I need to configure to prevent this error?

My website works well, but this error causes some problems, for example with the Quicktab module.

enter image description here

As you can see Tab Content disappeared and Tab Weight is changed to the select list. What do I need to do to fix this?

Besides that, I have other sites on this server; none of them has reported this error.

2 Answers 2

1

Drupal cannot contact itself. The system module reports this error when a system_check_http_request(). Assuming this is the cause of the AJAX errors, you could try, as the error message suggests, to set $conf['drupal_http_request_fails'] = FALSE; in your settings.php file. This might fix the symptoms, but not the cause however.

The fix lies in figuring out why this check fails:

drupal_http_request(url('', array('absolute' => TRUE)), array('max_redirects' => 0));

It could be that url() is not returning your front page URL. If you have drush on your server, you can run the command drush php-script my_test_script.php. With my_test_script.php containing a simple test script:

<?php echo url('', array('absolute' => TRUE)), array('max_redirects' => 0); ?>

If it is returning the correct home page URL, another likely problem, since you're hosting multiple sites, is that your domain is not resolving the correct virtual host. You can test this with the server command:

wget -O- http://www.example.com/

If your site's home page HTML is output to the console that should tell you that the server can contact the resolve & connect to itself. If this is the case it might be something like a PHP config preventing retrieval of HTTP URL's.

4
  • Tried this. url('', array('absolute' => TRUE)) gave me http://default/ (obviously wrong and explains why site can't reach itself). However in the status report, the external cron link is displayed as http://127.0.0.1:8888/cron.php?cron_key=.... After I set $base_url to http://localhost:8888 this error is still showing up. Any suggestions?
    – Koen
    Commented Aug 30, 2017 at 15:09
  • What if the test script results in "Call to undefined function url()"?
    – arnoldbird
    Commented Jan 15, 2020 at 15:35
  • It sounds like you're using D7 url() is a D7 function; the parent question is implicitly a D7 question; the error is particular to the D7 system module.
    – Shawn Conn
    Commented Jan 15, 2020 at 16:41
  • @ShawnConn I am on D7, so url() should work. Perhaps related, I see I can't wget my own domain from the command line. I can only wget other domains. But I don't see how that would result in my getting an "undefined function" error when I execute the script with drush.
    – arnoldbird
    Commented Jan 15, 2020 at 17:31
1

Too late, but… You could write the real IP of frontend but not resolved IP by DNS into the /etc/hosts of backend (where php is working), e.g.

Real site IP: 32.32.32.32 Frontend's IP: 192.168.1.65 Backend's IP: 192.168.1.68

192.168.1.65      mysite.com

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.