K
K
krll-k2014-08-11 15:18:55
linux
krll-k, 2014-08-11 15:18:55

How to know if curl is installed with openssl and zlib support? How to install curl from sources with openssl and zlib support?

When running codeception tests, an error occurs:

$ vendor/bin/codecept run
Codeception PHP Testing Framework v2.1.0
Powered by PHPUnit 4.2.0 by Sebastian Bergmann.

Unit Tests (0) ------------------------------
---------------------------------------------

Functional Tests (0) ------------------------
---------------------------------------------

Acceptance Tests (1) ----------------------------------------------------------------------------------------
Trying to perform actions and see result (testCept)                                                     Error
-------------------------------------------------------------------------------------------------------------


Time: 105 ms, Memory: 5.00Mb

There was 1 error:

---------
1) Failed to perform actions and see result in testCept (/home/krll/projects/test/tests/acceptance/testCept.php)
Can't be on page "/hello/world":
GuzzleHttp\Exception\RequestException: [curl] (#7) See http://curl.haxx.se/libcurl/c/libcurl-errors.html for an explanation of cURL errors [url] http://localhost:9000/hello/world

Scenario Steps:
1. I am on page "/hello/world"

#1  /home/krll/projects/test/vendor/guzzlehttp/guzzle/src/Adapter/Curl/MultiAdapter.php:176
#2  /home/krll/projects/test/vendor/guzzlehttp/guzzle/src/Adapter/Curl/MultiAdapter.php:160
#3  /home/krll/projects/test/vendor/guzzlehttp/guzzle/src/Adapter/Curl/MultiAdapter.php:139
#4  /home/krll/projects/test/vendor/guzzlehttp/guzzle/src/Adapter/Curl/MultiAdapter.php:103
#5  /home/krll/projects/test/vendor/guzzlehttp/guzzle/src/Adapter/StreamingProxyAdapter.php:34
#6  /home/krll/projects/test/vendor/guzzlehttp/guzzle/src/Client.php:186
#7  /home/krll/projects/test/vendor/symfony/browser-kit/Symfony/Component/BrowserKit/Client.php:327
#8  /home/krll/projects/test/tests/acceptance/AcceptanceTester.php:128
#9  /home/krll/projects/test/tests/acceptance/testCept.php:4
                                   
FAILURES!                          
Tests: 1, Assertions: 0, Errors: 1.

My searches led me to the Guzzlephp http client dependency page , which explicitly states the need to use cURL >= 7.16.2 compiled with OpenSSL and zlib
Another confirmation of this: an error caused in step 7: #7 /home/krll/projects/test/vendor/ symfony/browser-kit/Symfony/Component/BrowserKit/Client.php:327
$server['HTTP_HOST'] = $this->extractHost($uri);
        $server['HTTPS'] = 'https' == parse_url($uri, PHP_URL_SCHEME);

        $this->internalRequest = new Request($uri, $method, $parameters, $files, $this->cookieJar->allValues($uri), $server, $content);

        $this->request = $this->filterRequest($this->internalRequest);

        if (true === $changeHistory) {
            $this->history->add($this->internalRequest);
        }

        if ($this->insulated) {
            $this->response = $this->doRequestInProcess($this->request);
        } else {
            $this->response = $this->doRequest($this->request);
        }

        $this->internalResponse = $this->filterResponse($this->response);

        $this->cookieJar->updateFromResponse($this->internalResponse, $uri);

        $status = $this->internalResponse->getStatus();

        if ($status >= 300 && $status < 400) {
            $this->redirect = $this->internalResponse->getHeader('Location');
        } else {
            $this->redirect = null;
        }

How to install curl from sources with openssl and zlib support? I downloaded the latest version from curl.haxx.se/download.html and installed it, but how do I include openssl and zlib in them?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Semyon Voronov, 2014-08-13
@krll-k

1. curl -V
2. Installation from sources:

wget http://curl.haxx.se/download/curl-7.37.1.tar.gz
tar xzfv curl-7.37.1.tar.gz
cd curl-7.37.1/
# Документация по установке
less docs/INSTALL
# Список всех доступных опций  
./configure --help
# Нужные вам параметры компиляции
./configure --help | egrep "OpenSSL|zlib" | grep -v without
# Нужное вам
./configure --with-zlib --with-ssl

Most likely (if not installed) you will have to install the header files of the openssl and zlib libraries (libcurl4-openssl-dev, libzlcore-dev)
If successful, you should have ./configure output something like this:
configure: Configured to build curl/libcurl:

  curl version:     7.37.1
  Host setup:       x86_64-unknown-linux-gnu
  Install prefix:   /usr/local
  Compiler:         gcc
  SSL support:      enabled (OpenSSL)
  zlib support:     enabled

make
# Сборщик пакетов (придется установить пакет checkinstall
# Не пользуйтесь make install, это усложняет администрирование системы и засоряет ее.
checkinstall

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question