Group: http://groups.google.com/group/adsense-api/topics
- Authen by Service Account Error [7 Updates]
- galeksic <agencijaspecihost@gmail.com> Oct 22 12:00PM -0700
> *tried creating DB (examples.sqlite and table auth) but then I get
> different errors
> **General error: 26 file is encrypted or is not a database*
Did you created example.sqlite with lower SQLite version?
Would it be "safe" to rename that file and start auth again?
$dbh = new PDO('sqlite:examples.sqlite');
$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$stmt = $dbh->prepare('CREATE TABLE IF NOT EXISTS auth ' .
'(user VARCHAR(255), token VARCHAR(255))');
$stmt->execute();
https://code.google.com/p/google-api-php-client/source/browse/trunk/examples/adsense/AdSenseAuth.php#71
Or to create it "auto-manually" :)
<?php
/* create-example-sqlite.php */
try {
$dbh = new PDO("sqlite:example.sqlite");
$dbh = $dbh->prepare('CREATE TABLE IF NOT EXISTS auth ' .
'(user VARCHAR(255), token VARCHAR(255))');
$dbh->execute();
}
catch(PDOException $e)
{
echo $e->getMessage();
}
?>
- galeksic <agencijaspecihost@gmail.com> Oct 22 12:28PM -0700
@*Jose Alcérreca* I'm not frequent poster on this forum, but if you allow -
just one small suggestion / question :)
In Forum configuration, in "Information", on "Web view customization" page,
there should be "Source code highlighting" option - could it be enabled?
"*Code* highlighting" could perhaps be convenient option for AdSense API *
coders* - if that option exists on this forum, and if it is not disabled
because of some reason, of course. :)
- "Jose Alcérreca (AdSense API Team)" <adsenseapiadvisor+jose@google.com> Oct 23 02:21AM -0700
result = Jose.investigate()
print result
>>> Done!
Matteo,
Looks like it's a version mismatch problem. What versions of PHP and SQLite
are you using?
Jose
---
Jose Alcérreca
Developer Relations
Google UK Limited
Registered Office: Belgrave House, 76 Buckingham Palace Road, London SW1W
9TQ
Registered in England Number: 3977902
On Tuesday, 22 October 2013 20:28:56 UTC+1, galeksic wrote:
- galeksic <agencijaspecihost@gmail.com> Oct 23 03:10AM -0700
Oooops... infinite loop here. :)
Thank you!
Thank you!
Thank you!
<CTRL><C>
KeyboardInterrupt
- Matteo Giampaolo <mgiampaolo@gmail.com> Oct 23 09:09AM -0700
php 5.3.10
sqlite 2.8.17
- "Jose Alcérreca (AdSense API Team)" <adsenseapiadvisor+jose@google.com> Oct 23 09:29AM -0700
Matteo,
After a quick serach, in the PHP documentation I found:
In PHP 5.1, the SQLite <http://www.php.net/manual/en/ref.sqlite.php> extension
> easier to import legacy SQLite 2 database files into an application that
> uses the faster, more efficient SQLite 3 driver. As a result, the SQLite 2
> driver is not as feature-rich as the SQLite 3 driver.
Can you upgrade to SQLite 3?
Cheers,
Jose
---
Jose Alcérreca
Developer Relations
Google UK Limited
Registered Office: Belgrave House, 76 Buckingham Palace Road, London SW1W
9TQ
Registered in England Number: 3977902
On Wednesday, 23 October 2013 17:09:49 UTC+1, Matteo Giampaolo wrote:
- Matteo Giampaolo <mgiampaolo@gmail.com> Oct 23 10:24AM -0700
upgraded to sqlite3, modified code (AdSenseAuth.php to use sqlite3 --->
$dbh = new PDO('sqlite3:examples.sqlite')
Still receive error
oRuntime error: Could not json decode the token
#0 /dati/google-api-php-client/src/Google_Client.php(172):
Google_OAuth2->setAccessToken(NULL)
#1 /dati/google-api-php-client/examples/adsense/AdSenseAuth.php(86):
Google_Client->setAccessToken(true)
#2 /dati/google-api-php-client/examples/adsense/index.php(52):
AdSenseAuth->authenticate('sample_user')
BUT....Now I can enter in "examples.sample" DB (from outside php) and list
an empty "Auth" table created by AdSenseAuth code...
Thx
You received this message because you are subscribed to the Google Groups "AdSense API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adsense-api+unsubscribe@googlegroups.com.
To post to this group, send email to adsense-api@googlegroups.com.
Visit this group at http://groups.google.com/group/adsense-api.
For more options, visit https://groups.google.com/groups/opt_out.
No comments:
Post a Comment