FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Tokan error & 401 fatal error while running google analytics API code on dedicated server
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Tokan error & 401 fatal error while running google analytics API code on dedicated server [message #169725] Fri, 24 September 2010 06:25 Go to next message
neha rathi is currently offline  neha rathi
Messages: 4
Registered: September 2010
Karma: 0
Junior Member
Hi,


My trying a code to get page visits of all domains of my google
analytics account. My code is running properly on local xampp server &
i am getting visits for all domains but when i run the same code on
dedicated server. It gives me error as

401
Fatal error: Uncaught exception 'Exception' with message 'Permission
Denied - <HTML> <HEAD> <TITLE>Token invalid</TITLE> </HEAD> <BODY
BGCOLOR="#FFFFFF" TEXT="#000000"> <H1>Token invalid</H1> <H2>Error
401</H2> </BODY> </HTML> ' in /home/gauravhm/public_html/seo/admin/
domain_add/googleanalytics.class.php:274 Stack trace: #0 /home/
gauravhm/public_html/seo/admin/domain_add/
googleanalytics.class.php(195): GoogleAnalytics->_postTo('https://
www.goo...', Array, Array) #1 /home/gauravhm/public_html/seo/admin/
domain_add/googleanalytics.class.php(116): GoogleAnalytics-
> _callAPI('https://www.goo...') #2 /home/gauravhm/public_html/seo/
admin/domain_add/visits.php(76): GoogleAnalytics->getReport(Array) #3
{main} thrown in /home/gauravhm/public_html/seo/admin/domain_add/
googleanalytics.class.php on line 274



I am not understanding why this is happening? I echoed the responce of
google analytics API then I am getting 'http_code' == 200 on local but
401 on dedicated server.
curl is also properly installed..It showing curl is activated on local
& server also properly.
Can somebody please help.
Re: Tokan error & 401 fatal error while running google analytics API code on dedicated server [message #169733 is a reply to message #169725] Fri, 24 September 2010 09:10 Go to previous message
Helmut Chang is currently offline  Helmut Chang
Messages: 22
Registered: September 2010
Karma: 0
Junior Member
Am 24.09.2010 08:25, schrieb neha rathi:

> My trying a code to get page visits of all domains of my google
> analytics account. My code is running properly on local xampp server&
> i am getting visits for all domains but when i run the same code on
> dedicated server. It gives me error as
>
> 401
> Fatal error: Uncaught exception 'Exception' with message 'Permission
> Denied -

Read the message: It says, that an exception has been thrown, that you
didn't catch and handle (which is bad coding style).

And the message says: '401 Permission Denied', which means: your
dedicated server is not allowed to:

> googleanalytics.class.php(195): GoogleAnalytics->_postTo('https://
^^^^^^^
> www.goo...', Array, Array)

post to the google analytics url.

I'd say, one of the Array parameters of above method call contains
authentification credentials and those seem to be wrong.

Helmut
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Syntax for array?
Next Topic: [ANN] Release of XMLmind XSL-FO Converter v4.4.1
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Dec 04 08:33:04 GMT 2024

Total time taken to generate the page: 0.02226 seconds