Jump to content

Edit History

Tornevall

Tornevall

This is a very old thread as it seems, but as many others unsolved. Did you find out how to solve this? I had this problem myself during an installation of PrestaShop, where the installer obviously requires network access to reach language packas - and it is correct that Tools can be changed for this purpose.

A little catch though, is the fact that at least the installer needs both curl and streams to handle internet access through proxies, so it has to be done in two steps. Based on a http-squid proxy (for my own case), this solved the installation for me (and hopefully it might also help with other things in the platform).

First step is to look up private static function file_get_contents_curl( and add 

curl_setopt($curl, CURLOPT_PROXY, 'http://proxy.address:3128/');
curl_setopt($curl, CURLOPT_PROXYTYPE, 0);

... just after the rest of the setopt-rows.

Second step is to look up public static function file_get_contents( and update the same for the stream-client. The rows below is based on an installation of PrestaShop 1.7.7.5, where the parts proxy and request_fulluri is added for both http and https-proxies:

$stream_context = @stream_context_create(
    [
        'http' => ['timeout' => 3, 'proxy' => 'tcp://proxy.address:3128','request_fulluri' => true],
        'https' => ['proxy' => 'tcp://proxy.address:3128', 'request_fulluri' => true],
        'ssl' => ['cafile' => CaBundle::getBundledCaBundlePath()],
    ]
);

If the scripts does not accept at FQDN-host, you can simply use the ip-address. Since this was about an installation for me, after this I could click "retry" and proceed as usuall with the installation.

Tornevall

Tornevall

This is a very old thread as it seems, but as many others unsolved. Did you find out how to solve this? I had this problem myself during an installation of PrestaShop, where the installer obviously requires network access to reach language packas - and it is correct that Tools can be changed for this purpose.

A little catch though, is the fact that at least the installer needs both curl and streams to handle internet access through proxies, so it has to be done in two steps. Based on a http-squid proxy (for my own case), this solved the installation for me (and hopefully it might also help with other things in the platform).

First step is to look up private static function file_get_contents_curl( and add 

curl_setopt($curl, CURLOPT_PROXY, 'http://proxy.address:3128/');
curl_setopt($curl, CURLOPT_PROXYTYPE, 0);

... just after the rest of the setopt-rows.

Second step is to look up public static function file_get_contents( and update the same for the stream-client. The rows below is based on an installation of PrestaShop 1.7.7.5, where the parts proxy and request_fulluri is added for both http and https-proxies:

$stream_context = @stream_context_create(
    [
        'http' => ['timeout' => 3, 'proxy' => 'tcp://proxy.address:3128','request_fulluri' => true],
        'https' => ['proxy' => 'tcp://proxy.address:3128', 'request_fulluri' => true],
        'ssl' => ['cafile' => CaBundle::getBundledCaBundlePath()],
    ]
);

If the scripts does not accept at FQDN-host, you can simply use the ip-address.

×
×
  • Create New...