Previous1Next
Dominion IT
Posts: 126
Themes: 16
Plugins: 3
Downloads: 17.3k

Good day.

 

I have installed gpEasy for first time and have noticed I have a clean install, all goes well, all checkes passed no errors. 

but when I try and install a plugin via the download plugins option -> Install then it fails saying

Oops, the package download failed. Please try again later

Now I traced this to RemoteGet.php and noticed the Test function select the stream method as the prefered method to download the file. But that does not

work and fopen also does not work  but fsockopen does work. Anything I can look at on why this is the case ? (allow_url_fopen is true)

I recon this cant be set to a prefered method in the config file ?

 

Thank you for the great product

 

Johannes Pretorius

 

Dominion IT

 

3 years ago#3167
Josh S.
Posts: 1.5k
Themes: 16
Plugins: 15
Downloads: 115.3k

Wow, thanks for tracking all of that down. Which version of gpEasy are you using?

Anything I can look at on why this is the case ?

Try turning debugging on to see if there are any errors popping up. http://docs.gpeasy.com/Main/Debugging

There currently is not an option to set a prefered method for RemoteGet in the configuration.. ideally we wouldn't need one, but I can see your reasons for asking.

3 years ago#3171
Dominion IT
Posts: 126
Themes: 16
Plugins: 3
Downloads: 17.3k

Good day.

I am using versrion 2.3.3

I tried debugging but nothing, only error is the message

Oops, the package download failed. Please try again later(1)

I have changed the code to always use fsockopen on my server for now. I am busy trying to see if there is any other way I can get the streams to work correctly for then no code change will be needed.

PS : Basically the download plugin URL gets redirected to the correct path to download (It gets a 304 - Moved Temporarily back) and that is where the streams fall over, but fsockopen succeed.

Thanks once again for this great product.

(Busy trying to translate to Afrikaans, but it is a massive language file :D takes some time)

3 years ago#3176
Dominion IT
Posts: 126
Themes: 16
Plugins: 3
Downloads: 17.3k

Hi there, I found out why only the one way was working and not the others. This piece of code is missing from the others

[code]

 

$processedHeaders = gpRemoteGet::processHeaders($theHeaders);
 
// If location is found, then assume redirect and redirect to location.
if ( isset($processedHeaders['headers']['location']) ) {
if( $r['redirection']-- > 0 ){
 
//check location for releative value
$location = $processedHeaders['headers']['location'];
if( $location{0} = '/' ){
$location = $arrURL['scheme'].'://'.$arrURL['host'].$location;
}
return gpRemoteGet::Get($location, $r);
}else{
trigger_error('Too many redirects');
return false;
}
}
 
$strResponse = gpRemoteGet::chunkTransferDecode($strResponse,$processedHeaders);

[/code]

Only fsockopen has it , the other 2 methods miss it

 

fopen_request

and 

stream_request

 

When you add it, then it start to work. Thus nothing from with the streams or PHP / Apache install. Just not following the redirect.

 

thank you

 

Johannes Pretorius

 

3 years ago#3183
Josh S.
Posts: 1.5k
Themes: 16
Plugins: 15
Downloads: 115.3k

That's great news!

stream_get_contents() is suppose to follow redirects on it's own, but it's clearly not doing it consistently.

I'll update the gpEasy code. Thanks so much!

3 years ago#3192
Previous1Next

gpEasy News

4.3.2
2/18/2014

The final release of gpEasy 4.3.2 is now available. This is primarily a third-party package ... Read More

4.3 Final
11/4/2013

The wait is over. The final release of gpEasy 4.3 brings some exciting new features ... Read More

More News

Les sites de terenez.com

Web hosting et services en ligne, votre site Internet à partir de 25€/an *Aide gp|Easy en français

Find out more about gpEasy's Provider Spotlight

Log In

  Register