Can you help?
We have a plugin (Event Calendar Pro v2) that is throwing Fatal Errors when WP Cron job runs, which stops other plugin (notably CiviCRM) from completing their own Cron tasks.
PHP Warning: file_get_contents(http://api.sharedcount.com/DOMAIN) [<a href='function.file-get-contents'>function.file-get-contents</a>]: failed to open stream: no suitable wrapper could be found in /home/USER/public_html/sharecount.php on line 3
Need help debugging the fatal errors from Events Calendar Plugin so that other cron tasks can complete successfully.
Thanks
Marcus
Arnav Joy answers:
what this file is doing "sharecount.php" , and why it is placed on home folder?
can you share its code please.
Hariprasad Vijayan answers:
Hi,
Can you show your sharecount.php?
Check this thread
http://stackoverflow.com/questions/6551379/file-get-contents-error
might help you
Sébastien | French WordpressDesigner answers:
paste here your sharecount.php?
If you have access to your php.ini file, you can add this line inside :
allow_url_fopen = On
The problem will be resolved.
You can create a file php.ini wit php.ini with this line inside
allow_url_fopen = On
and add this file in /home/USER/public_html/
Ryan S answers:
This sounds like a server issue to me.
If allow_url_fopen is Off, you won't be able to use the http(s):// wrappers. If it's your server, you can turn it On using WHM, check phpinfo() or php.ini.
Hope that helps.
Francisco Javier Carazo Gil answers:
On sharecount.php on line 3, try to see if you are managing an URL or a local path.
The first one is like this: http://xxxx and the second, the good one is like this: /home/USER/public_html/...
Bob answers:
I think there is trouble with the url given in file_get_contents function.
somehow it is setting DOMAIN word as url.
The code on file might be something like this.
<?php
$url = ((!empty($_SERVER['HTTPS'])) ? "https://": "http://" ) . $_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
$json = file_get_contents("http://api.sharedcount.com/?url=" . rawurlencode($url) . "&apikey=XXXXXXX");
$counts = json_decode($json, true);
echo "This page has " . $counts["Twitter"] ." tweets, " . $counts["Facebook"]["like_count"] . " likes, and ". $counts["GooglePlusOne"] . "+1's";
?>
Here you can see there should be <strong>url</strong> and <strong>api key</strong> as parameter.
It is setting $url variable value by itself so you might not need to write url there directly.
Now the other thing is that you require apikey to make this call working. You can get api key by signing up at below url.
[[LINK href="https://admin.sharedcount.com/admin/signup.php"]]https://admin.sharedcount.com/admin/signup.php[[/LINK]]
Bob comments:
we can solve your problem if you provide is content of sharecount.php file.