Thread Starter
aiopa
(@aiopa)
Found some more Errors:
/pdf
gives error:
Failed to load PDF document
/pdf-preview
gives error:
Warning: file_get_contents(https://localhost/produkt/twizy-leasing/?pdf-template): failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request in /var/www/xxx/dist/wp-content/plugins/wp-pdf-templates/wp-pdf-templates.php on line 243
Warning: file_get_contents(http://localhost/produkt/twizy-leasing/?pdf-template): failed to open stream: Connection timed out in /var/www/xxx/dist/wp-content/plugins/wp-pdf-templates/wp-pdf-templates.php on line 247
Warning: file_get_contents(https://xxx/produkt/twizy-leasing/?pdf-template): failed to open stream: Connection timed out in /var/www/xxx/dist/wp-content/plugins/wp-pdf-templates/wp-pdf-templates.php on line 254
Thread Starter
aiopa
(@aiopa)
So i solved my problem by using cURL, I added this
function curl_get_contents($url) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
And changed
$html = file_get_contents( $link, false, $context );
$html = file_get_contents( str_ireplace( 'https://', 'http://', $link ), false, $context );
$html = file_get_contents( $link , false, $context );
To
$html = curl_get_contents( $link );
$html = curl_get_contents( str_ireplace( 'https://', 'http://', $link ) );
$html = curl_get_contents( $link );
Please where (file name and path) you made this change.
Thread Starter
aiopa
(@aiopa)
File:
/wp-content/plugins/wp-pdf-templates/wp-pdf-templates.php
And remember to backup this file!!
The problem is that I don’t have this template and this path.
Warning: stream_socket_client(): unable to connect to tcp://page (Connection refused) in /var/www/html/wordpress/wp-includes/class-wp-http-streams.php on line 150
This warning is only first time after you load web page at first time in current browser session. When you close browser and open again wordpress this warning is coming again ;-(
Success !
After updating theme problem solved 😉
Thx!
It’s good to hear you were able to fix the issue.
I don’t think we’re moving to curl any time soon due to curl-support missing on some hosting platforms.
Closing issue now.
Unfortunately after some traffic and several attempts
the problem occurs again ;-(
`
Warning: stream_socket_client(): unable to connect to tcp://mobileuiux.pl:80 (Connection refused) in /var/www/html/wordpress/wp-includes/class-wp-http-streams.php on line 150
`
Please look at this again (mobileuiux.pl
) and help me with this issue.
Thanks in advance !
Thread Starter
aiopa
(@aiopa)
Your issue is not with this pluggin 😛