Skip to content
This repository has been archived by the owner on Jun 7, 2020. It is now read-only.

v2 stopped working on my server #68

Closed
AlexandrKane opened this issue Oct 13, 2018 · 3 comments
Closed

v2 stopped working on my server #68

AlexandrKane opened this issue Oct 13, 2018 · 3 comments

Comments

@AlexandrKane
Copy link

AlexandrKane commented Oct 13, 2018

Hello friends
I have problems with this library.

I tried to use code on php 5.4 but it did not work. Then I updated php to version 5.5.38 and the code worked, I was very happy. But my happiness did not last long. After a week, I again began to receive an error:

Fatal error: Uncaught exception 'ErrorException' with message 'Unable to fetch jschl_vc and pass values; maybe not protected?' in /home/admin/web/mysite.com/public_html/engine/modules/calendar/src/CloudflareBypass/CFBypass.php:76 Stack trace: #0 /home/admin/web/mysite.com/public_html/engine/modules/calendar/src/CloudflareBypass/RequestMethod/CFCurl.php(87): CloudflareBypass\CFBypass->getClearanceLink('\r\n<...', 'https://www.liv...') #1 /home/admin/web/mysite.com/public_html/engine/modules/calendar/src/CloudflareBypass/RequestMethod/CFCurl.php(103): CloudflareBypass\RequestMethod\CFCurl->exec(Object(CloudflareBypass\RequestMethod\Curl), false, 3) #2 /home/admin/web/mysite.com/public_html/engine/modules/calendar/src/CloudflareBypass/RequestMethod/CFCurl.php(103): CloudflareBypass\RequestMethod\CFCurl->exec(Object(CloudflareBypass\RequestMethod\Curl), false, 2) #3 /home/admin/web/mysite.com/public_html/engine/modules/calendar/calendar.class.php(51): CloudflareBypass\RequestMethod\CFCurl->exec(Resource id #31) #4 in /home/admin/web/mysite.com/public_html/engine/modules/calendar/src/CloudflareBypass/CFBypass.php on line 76

I'm trying to get the content of the page
https://www.livechart.me/schedule/all?layout=full&date=2018-10-21

My code is:

$url = 'https://www.livechart.me/schedule/all?layout=full&date=2018-10-21';
$curl_cf_wrapper = new CFCurl(array(
			'cache'         => true,   // Caching now enabled by default; stores clearance tokens in Cache folder
			'max_retries'   => 5       // Max attempts to try and get CF clearance
		));
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36');
$document = $curl_cf_wrapper->exec($ch); // Done! NOTE: HEAD requests not supported!
curl_close($ch);

I suppose that it’s possible to deal with server settings, but I don’t know which ones. Because the code on the local server is working, But it stopped working on two different VDS.

Please help me solve this problem.

@bhrdn
Copy link

bhrdn commented Oct 26, 2018

screenshot from 2018-10-26 17-29-41

u can add the real ip address to /etc/hosts

@KyranRana
Copy link
Owner

Try again with the new version and let me know if it works?

@KyranRana
Copy link
Owner

v3.0.0 out now.

This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants