2

On a Red Hat Enterprise Linux Server release 7.1 (Maipo) development server using [Behat Drupal Extension][1], a RHEL 7 / PHP 5.4 installation. When I try to run behat from the command line on a dev server, I get the following error:

$ ./vendor/bin/behat

Feature: First Playing with features and exploring

@api

Scenario: Run cron # features/first.feature:6 PHP Fatal error: Call to undefined function GuzzleHttp\Handler\curl_reset()

in /var/www/html/sites/default/behat-tests/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php on line 78

From answers below, it appears the the version of Guzzle bundled with this requires 5.5 or greater.

  guzzlehttp/guzzle               6.1.0   Guzzle is a PHP HTTP client library
  guzzlehttp/promises             1.0.3   Guzzle promises library
  guzzlehttp/psr7                 1.2.0   PSR-7 message implementation

My question: what version of Guzzle should I use in order to be able to run test on a server with PHP 5.4?

1 Answer 1

4

Call to undefined function GuzzleHttp\Handler\curl_reset()

Means PHP is trying to find the function curl_reset() in the namespace GuzzleHttp\Handler.

It does that because it can't find it in the global namespace (where it should be). curl_reset() was only introduced in PHP 5.5, and you have version 5.4, so your version just isn't compatible with Guzzle 5.

Guzzle isn't explicitly listed as a dependency in the Behat extension's composer.json file, so one of the other libraries must depend on it. I'm not sure it would even be worth the time trying to unpick that, upgrading php would be much quicker.

3
  • This doesn't appear to be an option for me. Is there an alternative to this.
    – Rick
    Oct 22, 2015 at 16:04
  • 2
    I was wrong, it's your PHP version - Guzzle 5 requires >=php5.5 so it won't work on php5.4. I've updated the answer, no easy fix that I know of except to upgrade php
    – Clive
    Oct 22, 2015 at 17:00
  • 3
    You can possibly use an older Behat release that only requires Guzzle 3.
    – cilefen
    Oct 22, 2015 at 18:46

Your Answer

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

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