Comments (21)
Are you sure your shariff.json
is in the right place and is valid JSON syntax?
from shariff-backend-php.
Btw: If you use Shariff with a CMS, considering using one of the extensions/plugins available for many of those, see Readme.
from shariff-backend-php.
Thanks.
We do not use shariff with a cms.
We have used the shariff.jason-format which was delivered.
We changed only the domain name.
What else can be wrong?
We have shariff on an ubuntu apache server.
Am 30.01.2016 um 17:49 schrieb Markus Klein [email protected]:
Btw: If you use Shariff with a CMS, considering using one of the extensions/plugins available for many of those, see Readme.
—
Reply to this email directly or view it on GitHub.
from shariff-backend-php.
Can you post your shariff.json
here please
from shariff-backend-php.
here is the shariff.json content:
{
"cache": {
"ttl": 60
},
"domain": "www.mydomain.de",
"services": [
"GooglePlus",
"Facebook",
"LinkedIn",
"Reddit",
"StumbleUpon",
"Flattr",
"Pinterest",
"Xing",
"AddThis"
]
}
from shariff-backend-php.
i have recognised that in same directory is a ".htaccess"-file which is only readable by root.
the content of the .htaccess is:
Header set Access-Control-Allow-Origin "*"
Is this the problem?
from shariff-backend-php.
i have recognised the error-directory doesn't exist on the server and in your backend-directory:
/vendor/zendframework/zend-config/Zend/Config/Reader/Json.php
only this directory does exist:
/vendor/zendframework/zend-config/src/Reader/Json.php
I guess that the json-file is not the problem.
Do you agree?
additional ...
we get a reponse after a long time (4 minutes) :
HTTP/1.1 200 OK
Date: Mon, 01 Feb 2016 10:50:38 GMT
Server: Apache/2.4.7 (Ubuntu)
X-Powered-By: PHP/5.5.9-1ubuntu4.14
Access-Control-Allow-Origin: *
Content-Length: 105
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: application/json
{"googleplus":0,"facebook":127,"linkedin":0,"reddit":0,"stumbleupon":0,"flattr":0,"pinterest":0,"xing":0}
from shariff-backend-php.
@ibubernie: Which version of shariff-backend-php
do you use?
Please use the provided highlighting options for your pastes.
from shariff-backend-php.
@compeak: thanks for your advise.
We use two different versions:
backend Version 1.4 / (04.02.2015)
backend Version 4.0.1 / (28.01.2016)
both versions shows the same result!
from shariff-backend-php.
The shariff.json
seems to be correct.
Can you please put a client timeout of 4 seconds in it and check the response time and error log again.
from shariff-backend-php.
The long timeout is due to the fallback to the default value, because the json can't be read correctly.
from shariff-backend-php.
- i changed the shariff.json in both backend-versions:
{ "cache": { "ttl": 60 }, ** "client": { "timeout": 4.2 }** "domain": "www.gwen-mag.de", "services": [ "GooglePlus", "Facebook", "LinkedIn", "Reddit", "StumbleUpon", "Flattr", "Pinterest", "Xing", "AddThis" ] }
- next step i restartet apache
- next i checked the apache-error.log
there is an error entry for both versions:
[Mon Feb 01 14:47:20.193671 2016] [:error] [pid 15079] [client 84.148.144.23:54199] PHP Fatal error: Uncaught exception 'Zend\\Config\\Exception\\RuntimeException' with message 'Decoding failed: Syntax error' in /var/www/mydomain.de-shariff/gwenmag/vendor/zendframework/zend-config/src/Reader/Json.php:50\nStack trace:\n#0 /var/www/mydomain.de-shariff/gwenmag/index.php(21): Zend\\Config\\Reader\\Json->fromFile('shariff.json')\n#1 /var/www/mydomain.de-shariff/gwenmag/index.php(26): Application::run()\n#2 {main}\n thrown in /var/www/mydomain.de-shariff/gwenmag/vendor/zendframework/zend-config/src/Reader/Json.php on line 50 [Mon Feb 01 14:47:42.203086 2016] [:error] [pid 15085] [client 84.148.144.23:54205] PHP Fatal error: Uncaught exception 'Zend\\Config\\Exception\\RuntimeException' with message 'Decoding failed: Syntax error' in /var/www/mydomain.de-shariff/gwen/vendor/zendframework/zend-config/Zend/Config/Reader/Json.php:50\nStack trace:\n#0 /var/www/mydomain.de-shariff/gwen/index.php(21): Zend\\Config\\Reader\\Json->fromFile('shariff.json')\n#1 /var/www/mydomain.de-shariff/gwen/index.php(26): Application::run()\n#2 {main}\n thrown in /var/www/mydomain.de-shariff/gwen/vendor/zendframework/zend-config/Zend/Config/Reader/Json.php on line 50
from shariff-backend-php.
Sorry I forgot the comma after timeout:
{ "cache": { "ttl": 60 }, "client": { "timeout": 4.2 }, "domain": "www.gwen-mag.de", "services": [ "GooglePlus", "Facebook", "LinkedIn", "Reddit", "StumbleUpon", "Flattr", "Pinterest", "Xing", "AddThis" ] }
- After restarting apache
- call the shariff-backend-test-link
- checking the apache-error-log: no error in the which refers to shariff-backend
summary:
ok. we got no errors in the log after setting the client>timeout to 4 second.
But the response time of the shariff-backend-link is still long (4 minutes) :
from shariff-backend-php.
@ibubernie: Did you fix it and how did you do it?
from shariff-backend-php.
No, I didn't fix it.
I am looking for another solution.
The shariff backend is to slow.
By the way:
could you prove this syntax.
Maybe there is an error and I didn't see it:
_<div id="main_ContentDetail_shariffdivid" class="shariff" data-backend-url="http://shariff.mydomain.de/gwen/" data-services="["twitter","facebook","googleplus","pinterest","info"]" data-theme="standard" data-orientation="horizontal" data-lang="de" data-media-url="http://www.mydomain.de/images/article/detail/schlittenhunderennen_ti_todtmoss_gwen_magazine.jpg-1212.jpg" data-url="http://www.mydomain.de/artikel/reisen/abseits_der_pisten-200.html"><ul class="theme-standard orientation-horizontal col-5"><li class="shariff-button twitter"><a href="https://twitter.com/intent/tweet?text=%0A%09Abseits%20der%20Pisten%20%7C%20GWEN%20Magazin%0A&url=http%3A%2F%2Fwww.mydomain.de%2Fartikel%2Freisen%2Fabseits_der_pisten-200.html" data-rel="popup" title="Bei Twitter teilen" role="button" aria-label="Bei Twitter teilen"><span class="fa fa-twitter"></span><span class="share_text">tweet</span></a></li><li class="shariff-button facebook"><a href="https://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2Fwww.mydomain.de%2Fartikel%2Freisen%2Fabseits_der_pisten-200.html" data-rel="popup" title="Bei Facebook teilen" role="button" aria-label="Bei Facebook teilen"><span class="fa fa-facebook"></span><span class="share_text">teilen</span> <span class="share_count">127</span></a></li><li class="shariff-button googleplus"><a href="https://plus.google.com/share?url=http%3A%2F%2Fwww.mydomain.de%2Fartikel%2Freisen%2Fabseits_der_pisten-200.html" data-rel="popup" title="Bei Google+ teilen" role="button" aria-label="Bei Google+ teilen"><span class="fa fa-google-plus"></span><span class="share_text">teilen</span> <span class="share_count">0</span></a></li><li class="shariff-button pinterest"><a href="https://www.pinterest.com/pin/create/link/?url=http%3A%2F%2Fwww.mydomain.de%2Fartikel%2Freisen%2Fabseits_der_pisten-200.html&media=http%3A%2F%2Fwww.mydomain.de%2Fimages%2Farticle%2Fdetail%2Fschlittenhunderennen_ti_todtmoss_gwen_magazine.jpg-1212.jpg&description=%0A%09Abseits%20der%20Pisten%20%7C%20GWEN%20Magazin%0A" data-rel="popup" title="Bei Pinterest pinnen" role="button" aria-label="Bei Pinterest pinnen"><span class="fa fa-pinterest-p"></span><span class="share_text">pin it</span> <span class="share_count">1</span></a></li><li class="shariff-button info"><a href="http://ct.de/-2467514" target="_blank" title="weitere Informationen" role="button" aria-label="weitere Informationen"><span class="fa fa-info"></span><span class="share_text">Info</span></a></li></ul></div>_
from shariff-backend-php.
The HTML you posted seems OK. I looked at your website and shariff
(the frontend) works as intended.
Why did you configure the backend to retrieve values for services you don't use?
from shariff-backend-php.
I don't have any trouble with the backend. It is as fast as the services answer.
And when it's cached then you don't realize its loaded afterwards.
This is on frequently visited pages and the server hasn't any problems with it.
So there must be a problem with your server and not with the backend
from shariff-backend-php.
I have now reduced the backend-services to twitter, facebook, googleplus and pinterest:
{ "cache": { "ttl": 60 }, "client": { "timeout": 10 }, "domain": "www.gwen-mag.de", "services": [ "Twitter", "Facebook", "GooglePlus", "Pinterest" ] }
Now the shariff-backend is fast!
backend Version 1.4 / (04.02.2015)
But now the twitter-count are gone.
No Twitter-count are comming back
{"facebook":127,"googleplus":0,"pinterest":0}
backend Version 4.0.1 / (28.01.2016)
No counts are comming back
An error was created in the apache-log:
[Tue Feb 02 15:44:57.292738 2016] [:error] [pid 40609] [client 84.148.142.86:61358] PHP Fatal error: Class 'Heise\Shariff\Backend\Twitter' not found in /var/www/ibumedia.de-shariff/gwenmag/src/Backend/ServiceFactory.php on line 62
Is twitter supported by the shariff-backend?
from shariff-backend-php.
So, I know the problem and here is the solution.
We have had added Twitter to the json-file the between the posts.
Know I removed twitter from the json file and the shariff-backend works fast and fine.
So I realized now that Twitter isn't supported by the shariff-backend.
I read it now additonal on the homepage.
Why is twitter not supported?
Thanks to all for the help.
from shariff-backend-php.
Twitter itself stopped support for the counter. This is not shariff specific.
What I did:
Used an alternative Twitter Counter Backend (opensharecount) and simply changed the request link in the backend.
Pro:
- you have the twitter counter back
Neg:
- the service is slow
- just show the counts since you registered you page there
from shariff-backend-php.
I like to make a short summary to my problem and the solution:
what I did:
- I installed the shariff-backend on an ubutu-apache-php server.
- I changed the shariff.json with my domain-name
- I added a Twitter-services
symptom:
the json response of the shariff-backend was very slow.
solution:
- I removed the unused services from the json-file
- I removed the not supported Twitter-Service
result:
The shariff-backend-service is fast now.
from shariff-backend-php.
Related Issues (20)
- Shariff Backend unter Centos 7.3 und bei Rails-App - Route not found - was ist falsch HOT 4
- 800 files in vendor folder HOT 1
- Wrong Facebook informations are crashing the whole app HOT 2
- Shariff: PHP Fatal error: Uncaught exception HOT 4
- Facebook-count is zero, but facebook debugger returns 30 HOT 11
- Google-Counter immer 0? HOT 9
- Feature Request: Tracking-Suffix an URL HOT 2
- New release? HOT 2
- Raise version constraint for friendsofphp/php-cs-fixer HOT 1
- [Support Request] How to install backend to use it with Drupal HOT 7
- Receive Likes from http URL HOT 2
- Rate Limiting on the Facebook Graph API
- Request for share counts on linked in return eror 404 HOT 5
- Only gets counts on Xing HOT 2
- Support for PHP 8 HOT 3
- Reddit not returning share count HOT 3
- guzzlehttp/guzzle 7+ support?
- Flattr backend link does not exist anymore HOT 4
- Support PHP 8.2
- Allow PHP 8.3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shariff-backend-php.