Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-2373

CiviContribute GoogleIPN.php getallheaders() error when running PHP as CGI

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 1.9
    • Fix Version/s: 2.0
    • Component/s: CiviContribute
    • Labels:
      None

      Description

      With CiviCRM/CiviContribute on a host that runs PHP as CGI the post-order callback from Google to googleNotify.php fails with the error:

      "Fatal error: Call to undefined function getallheaders() in [MY_PATH]/drupal/sites/all/modules/civicrm/CRM/Core/Payment/GoogleIPN.php on line 575"

      The problem is that getallheaders() is not available when PHP is run as CGI. The problem can be resolved by patching GoogleIPN.php by:

      1. Defining the function emu_getallheaders() somewhere in GoogleIPN.php

      (from http://forums.digitalpoint.com/showthread.php?p=4768191:)

      function emu_getallheaders() {
      foreach($_SERVER as $name => $value)
      if(substr($name, 0, 5) == 'HTTP_')
      $headers[str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))))] = $value;
      return $headers;
      }

      2. Replacing the single call to getallheaders() in GoogleIPN.php line 575.

      See forum post: http://forum.civicrm.org/index.php?topic=1472

        Attachments

          Activity

            People

            • Assignee:
              junia Junia Biswas
              Reporter:
              maryee Martin Aryee
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: