Git Product home page Git Product logo

Comments (21)

liayn avatar liayn commented on September 25, 2024

Are you sure your shariff.json is in the right place and is valid JSON syntax?

from shariff-backend-php.

liayn avatar liayn commented on September 25, 2024

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.

ibubernie avatar ibubernie commented on September 25, 2024

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.

liayn avatar liayn commented on September 25, 2024

Can you post your shariff.json here please

from shariff-backend-php.

ibubernie avatar ibubernie commented on September 25, 2024

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.

ibubernie avatar ibubernie commented on September 25, 2024

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.

ibubernie avatar ibubernie commented on September 25, 2024

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.

compeak avatar compeak commented on September 25, 2024

@ibubernie: Which version of shariff-backend-php do you use?

Please use the provided highlighting options for your pastes.

from shariff-backend-php.

ibubernie avatar ibubernie commented on September 25, 2024

@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.

compeak avatar compeak commented on September 25, 2024

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.

liayn avatar liayn commented on September 25, 2024

The long timeout is due to the fallback to the default value, because the json can't be read correctly.

from shariff-backend-php.

ibubernie avatar ibubernie commented on September 25, 2024
  1. 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" ] }
  2. next step i restartet apache
  3. 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.

ibubernie avatar ibubernie commented on September 25, 2024

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" ] }

  1. After restarting apache
  2. call the shariff-backend-test-link
  3. 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.

compeak avatar compeak commented on September 25, 2024

@ibubernie: Did you fix it and how did you do it?

from shariff-backend-php.

ibubernie avatar ibubernie commented on September 25, 2024

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="[&quot;twitter&quot;,&quot;facebook&quot;,&quot;googleplus&quot;,&quot;pinterest&quot;,&quot;info&quot;]" 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&amp;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>&nbsp;<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>&nbsp;<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&amp;media=http%3A%2F%2Fwww.mydomain.de%2Fimages%2Farticle%2Fdetail%2Fschlittenhunderennen_ti_todtmoss_gwen_magazine.jpg-1212.jpg&amp;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>&nbsp;<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.

compeak avatar compeak commented on September 25, 2024

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.

craiq avatar craiq commented on September 25, 2024

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.

ibubernie avatar ibubernie commented on September 25, 2024

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.

ibubernie avatar ibubernie commented on September 25, 2024

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.

craiq avatar craiq commented on September 25, 2024

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.

ibubernie avatar ibubernie commented on September 25, 2024

I like to make a short summary to my problem and the solution:

what I did:

  1. I installed the shariff-backend on an ubutu-apache-php server.
  2. I changed the shariff.json with my domain-name
  3. I added a Twitter-services

symptom:
the json response of the shariff-backend was very slow.

solution:

  1. I removed the unused services from the json-file
  2. I removed the not supported Twitter-Service

result:
The shariff-backend-service is fast now.

from shariff-backend-php.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.