Notice: Undefined variable: errno in drupal_http_request() (line 829 of /home/vol14/byethost11.com/b11_6950981/dgil.iblogger.org/htdocs/drupal-7.0-rc2/includes/common.inc).
Notice: Undefined variable: errstr in drupal_http_request() (line 830 of /home/vol14/byethost11.com/b11_6950981/dgil.iblogger.org/htdocs/drupal-7.0-rc2/includes/common.inc).

CommentFileSizeAuthor
#10 1002538.patch1.14 KBswentel
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

thehil’s picture

Priority: Normal » Critical
thehil’s picture

Priority: Critical » Major
Josh The Geek’s picture

Title: Notices after new Drupal 7 RC2 installation » Notices after fresh installation
Version: 7.0-rc2 » 7.x-dev
Priority: Major » Critical

Drupal policy is to test bugs against dev releases.

Josh The Geek’s picture

Priority: Critical » Major

I posted at the same time as you and changed the priority.

Sivaji_Ganesh_Jojodae’s picture

Status: Active » Postponed (maintainer needs more info)

thehil, did you read this ?

If you are reporting a bug, it needs to consist of three things:

What are the steps required to reproduce the bug?
What behavior were you expecting?
What happened instead?

Please include as much information as you can: OS, webserver name and version, PHP version, Drupal version, Drupal path, and everything else you might feel is relevant. There is no such thing as a bug report that is too detailed.

aranofacundo’s picture

I have the same problem with Drupal 7 RC2 and RC3

Notice: Undefined variable: errno in drupal_http_request() (line 829 of /home/vol3/byethost13.com/b13_6257237/htdocs/includes/common.inc).
Notice: Undefined variable: errstr in drupal_http_request() (line 830 of /home/vol3/byethost13.com/b13_6257237/htdocs/includes/common.inc).

It appears sometimes when i try to use Update Manager (admin/reports/updates/update). My web hosting is Byethost (http://byethost.com).

Hosting
Web server: Apache
PHP: 5.2.12
MySQL: 5.0.87-d10-ourdelta65
PHP extensions: Enable
PHP Memory: 24M
PHP register globals: Disabled
Unicode library: PHP Mbstring Extension

aranofacundo’s picture

Version: 7.x-dev » 7.0
Priority: Major » Normal
Status: Postponed (maintainer needs more info) » Active

I reinstalled Drupal 7 and I have the same errors.

Notice: Undefined variable: errno in drupal_http_request() (line 829 of /home/vol3/byethost13.com/b13_6257237/htdocs/includes/common.inc).
Notice: Undefined variable: errstr in drupal_http_request() (line 830 of /home/vol3/byethost13.com/b13_6257237/htdocs/includes/common.inc).

It appears sometimes when i try to use Update Manager (admin/reports/updates/update). My web hosting is Byethost (http://byethost.com).

Hosting
Web server: Apache
PHP: 5.2.12
MySQL: 5.0.87-d10-ourdelta65
PHP extensions: Enable
PHP Memory: 24M
PHP register globals: Disabled
Unicode library: PHP Mbstring Extension

Josh The Geek’s picture

Version: 7.0 » 7.x-dev
Priority: Normal » Major

Drupal policy to test bugs against dev releases.

droplet’s picture

byethost.com is a free hosting, blocked http request (even cannot using some PHP functions I guess)

we can add a simple $var checks there, but should we do it ??

swentel’s picture

Status: Active » Needs review
FileSize
1.14 KB

Attached patch checks on the strings. Untested, but should do the job fine.

Alan D.’s picture

Status: Needs review » Needs work

In PHP, the string "" is read as FALSE or empty. ;)

Better readability:

$result->code = empty($errno) ? -1 : -$errno;

And maybe:

$result->error = isset($errstr) ? trim($errstr) : '';
if (!$result->error) {
$result->error = t('Error opening socket @socket', array('@socket' => $socket));
}

or using trim twice, singular condition:

$result->error = isset($errstr) && trim($errstr) ? trim($errstr) : t('Error opening socket @socket', array('@socket' => $socket));

chx’s picture

Version: 7.x-dev » 8.x-dev
Priority: Major » Minor
Status: Needs work » Closed (won't fix)

Normally

  if (empty($options['context'])) {
    $fp = @stream_socket_client($socket, $errno, $errstr, $options['timeout']);
  }
  else {
    // Create a stream with context. Allows verification of a SSL certificate.
    $fp = @stream_socket_client($socket, $errno, $errstr, $options['timeout'], STREAM_CLIENT_CONNECT, $options['context']);
  }

this will initialize $errno and $errstr as NULL because


[chx@veyron2 tmp]$ php --rf stream_socket_client
Function [ <internal:standard> function stream_socket_client ] {

  - Parameters [6] {
    Parameter #0 [ <required> $remoteaddress ]
    Parameter #1 [ <optional> &$errcode ]
    Parameter #2 [ <optional> &$errstring ]

they are taken by reference. If your PHP is crippled by your host then ... don't use them, I guess.

javyerso’s picture

Status: Closed (won't fix) » Needs review

#10: 1002538.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, 1002538.patch, failed testing.

Agitaous11-1’s picture

Version: 8.x-dev » 7.10

Notice: Undefined variable: errno in drupal_http_request() (line 829 of /home/***.com/httpdocs/includes/common.inc).
Notice: Undefined variable: errstr in drupal_http_request() (line 830 of /home/***.com/httpdocs/includes/common.inc).

Updated to 7.10 and still the same problem.
Globals are open at the moment.
By the way, I have a paid hosting. They say, if you find out the problem; and it's about us; we will do out best to fix it.

oriol_e9g’s picture

Version: 7.10 » 8.x-dev

We need solve this in D8 first or won't fix if is a hosting problem.

Agitaous11-1’s picture

Status: Needs work » Active

Dear Oriol_e9g; you are right. If this is a hosting problem; you can not or should not fix it with Drupal7 or Drupal8. But If I do not have the required configuration info; I can not fix it or tell to fix to my hosting.

I am reactivating, because there is no work for D7. If won't fix, please inform.

mikeytown2’s picture

Title: Notices after fresh installation » Notices after fresh installation drupal_http_request
Version: 8.x-dev » 7.x-dev

Moving this to D7 as D8 is using Guzzle.

sushis’s picture

Same problem with D7_22. After the installation these errors appear.

This bug has more than 3 years! (December 2010).

This poses much problem for the development of the site?

godot882’s picture

To those who run into the same problem, it is probably a "problem" with the hosting. In my case my host provider disabled the steam_socket_client by default. If you can enable it or ask them to do so.