Hi guys, I don't know if the server guys changed anything but I suddenly got

Notice: Undefined offset: 1 in drupal_http_request() (line 989 of /home/fivestor/public_html/demo8/includes/common.inc).
Notice: Undefined offset: 2 in drupal_http_request() (line 993 of /home/fivestor/public_html/demo8/includes/common.inc).
Notice: Undefined offset: 1 in drupal_http_request() (line 993 of /home/fivestor/public_html/demo8/includes/common.inc).

On all my websites at that server. Can you please tell me why this would happen and how I can ask them to repair whatever it it causing these errors?

Any help would be appreciated.

Regards

Rick

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bappa.sarkar’s picture

I think the url you are fetching is not available or your server not able to request the URL.

rickharington’s picture

Hi bappa.sarkar

Thank you for the reply. This is happening on all my sites. Any idea how I can fix that?

Thanks for the help.

bappa.sarkar’s picture

Install devel module.

goto /devel/php

dsm(drupal_http_request('http://www.google.com/'));

Press Execute.

expand the output and take the screen shot and attach here.

rickharington’s picture

FileSize
47.98 KB

Hi bappa.sarkar

Thank for getting back to me. This is what I got.

rickharington’s picture

FileSize
68.2 KB
119.39 KB

Sorry I forgot to expand

bappa.sarkar’s picture

You didn't got any PHP Notice when you are fetching google.com.
Can you follow #3 for the URLs for which you are receiving PHP Notices?

drupauler’s picture

Issue summary: View changes
FileSize
58.23 KB

Same here, but when I create a new system on a hosted account with cpanel). Existing systems work fine.

My procedure is create a new subdomain, clone a working drupal system into the hitherto empty subdomain folder, create aDB and update settings.php to reference it, then run install.php.

reports/status reports

Notice: Undefined offset: 1 in drupal_http_request() (line 989 of /home/sites/paudax.com/public_html/dev3/includes/common.inc).
Notice: Undefined offset: 2 in drupal_http_request() (line 993 of /home/sites/paudax.com/public_html/dev3/includes/common.inc).
Notice: Undefined offset: 1 in drupal_http_request() (line 993 of /home/sites/paudax.com/public_html/dev3/includes/common.inc).

and

Error
HTTP request status Fails
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.

Report from devel attached (image 001) as above. Any pointers would be helpful!

drupauler’s picture

redacted

Rory.Davies’s picture

I got the same set of messages as #7 when updating core from 7.22 to 7.26.
I tried fiddling with includes/common.inc (as suggested in some threads about Drupal parsing variants in the HTTP response header) but that made no difference.

I updated my settings.php to the 7.26 template (mine was way older) and that made no difference either.
I checked that modules could be updated, then added the line to it as suggested ($conf['drupal_http_request_fails'] = FALSE;). Both sets of error messages disappeared.

So I presume that a) whatever is testing for the second error message does something which also causes the first set, and b) adding the flag in settings.php skips that test so neither error is reported.
Luckily, the language used in the second error message suggests it might be related to the first. Otherwise I would still be trying to fix what looks like a major error before I worried about what seems a less important one.

If it's possible to prevent the second test triggering both error messages, that would be good. I'm sorry I'm nowhere near competent to help with that.

ravi_admec’s picture

hi friends,
before few days, i faced the same issue.
I searched out a lot but nothing found.

Generally i don't have time to put the solution but today i felt that i should help people like me who r seriously in trouble becoz of any issue in drupal.

i found a way around.
//comment the following line
//list($protocol, $code, $status_message) = explode(' ', trim(array_shift($response)), 3);

//add these lines
$status_data=explode(' ', trim(array_shift($response)), 3);
if (!isset($status_data[2])) $status_data[2]='OK';
if (!isset($status_data[1])) $status_data[1]='Switching Protocols';

list($protocol, $code, $status_message) = $status_data;
//newly added lines end here

both of the errors will be disappeared.

drupalexphyd’s picture

In Which Above lines need to be add

ravi_admec’s picture

hi drupalexphpyd,

you can find these lines of code in common.inc file it is available in includes folder.

twistor’s picture