Git Product home page Git Product logo

Comments (37)

Daandelange avatar Daandelange commented on June 3, 2024 1

Hello, yes, the command line sqlite3 is installed, but the PHP module with the same name is probably not, as it's not listed in your "PHP extensions", neither is "pdo_sqlite". You need to enable the PHP module.
This one --> https://www.php.net/manual/en/class.sqlite3.php

from kirby3-simplestats.

Daandelange avatar Daandelange commented on June 3, 2024 1

You're welcome, I'm happy it works now. :)

from kirby3-simplestats.

Daandelange avatar Daandelange commented on June 3, 2024

Hello, your plugin should be up & running.

  • Any issues should be reported to site/logs/simplestats_errors.txt.
  • The panel is for viewing the collected stats only. After 24h there should be something visible. You can also view the raw database file with an SQL viewer (site/logs/simplestats.sqlite).
  • You can customise your setup up in site/config/config.php like any other kirby plugin. (available options to override are listed in options.php)

from kirby3-simplestats.

JolinM avatar JolinM commented on June 3, 2024

Hi Daandelange, thanks for the quick support! It’s still a bit fuzzy for me, but I’ll wait 24h and see if something’s pops up.
Right now, I only have the plugin on my local installation (laravel valet). Is this a problem?

  1. I don’t currently see the log folder.
    Capture d’écran, le 2021-01-15 à 11 53 25

And in my panel, it is unclear where I should go to see the stats 🤔
Capture d’écran, le 2021-01-15 à 11 53 12

from kirby3-simplestats.

Daandelange avatar Daandelange commented on June 3, 2024

image
It should be in your site's main menu. If not, there might be something wrong...

from kirby3-simplestats.

JolinM avatar JolinM commented on June 3, 2024

Oh! This is so easy! 🤦‍♂️

I have a new error message now 😬
Capture d’écran, le 2021-01-15 à 13 37 06

from kirby3-simplestats.

JolinM avatar JolinM commented on June 3, 2024

And on my remote install, this is the error message Class 'SQLite3' not found. 😔

from kirby3-simplestats.

Daandelange avatar Daandelange commented on June 3, 2024

For the Database issue, I'll try to reproduce it. Do your dev tools' network monitor reveal something more useful ? Is there something in simplestats_errors.txt ?
The 2nd one speaks for itself, you don't have SQLite3 enabled on your server. (worth looking if you can enable it trough php.ini or your hoster's admin panel)

from kirby3-simplestats.

Daandelange avatar Daandelange commented on June 3, 2024

There were some files missing for being plug-and play. Can you test with the latest version ?

from kirby3-simplestats.

JolinM avatar JolinM commented on June 3, 2024

Hey Daandelange, I reinstalled with your new version.

Will look into activating 'QLite3 on the remote one.
Same error message on the local. Dev console says [Error] Failed to load resource: the server responded with a status of 500 (Internal Server Error) (pagestats, line 0)

from kirby3-simplestats.

Daandelange avatar Daandelange commented on June 3, 2024

I've tested the plugin on a fresh install, the latest version works on my side, but that's only 1 possible configuration.
If you're familiar with php code, you can enable Kirby debugging and trace back errors that don't appear in site/logs/simplestats_errors.txt.

Edit: #7 says you might have to create the site/logs folder so the database file can be created.

from kirby3-simplestats.

JolinM avatar JolinM commented on June 3, 2024

Hey there, I tried on a fresh install as well. Same error Unable to open database: unable to open database file.
And on both install, even with Kirby debugging, the logs folder is missing.

If it might help, I’m running my local version through the latest version of Valet. Don’t know if it’s relevant.

from kirby3-simplestats.

Daandelange avatar Daandelange commented on June 3, 2024

Did you try creating the logs folder ? (after which the db and log file should appear on visiting your website ?)
If not, the plugin is probably not able to load itself correctly in Kirby, maybe it's something to do with Valet.

from kirby3-simplestats.

JolinM avatar JolinM commented on June 3, 2024

Bingo, got it. Now works on my local installation :)
There’s no stats, but I guess this is because it’s local, duh.
Got some error thought. I’ll let you know how it goes on my remote install as soon as I got SQLite on it.
simplestats_errors.txt

from kirby3-simplestats.

JolinM avatar JolinM commented on June 3, 2024

Hum, on dubious. On the remote, my hosting companies informed me SQlite 3 is in place, and the Terminal agrees.

Capture d’écran, le 2021-01-18 à 12 13 27

from kirby3-simplestats.

Daandelange avatar Daandelange commented on June 3, 2024

The error in your logfile has just been fixed. (update simplestats)

As for SQLite3... that screenshot looks like the unix command line binary, what you need is the PHP Module.
You could try removing the \ here.
Otherwise, as a temporary solution, upload the locally generated database to your online server, to bypass the SQLite3 requirement.

from kirby3-simplestats.

JolinM avatar JolinM commented on June 3, 2024

With the new version and the upload of the simplestats.sqlite file, I have a new error! could not find driver

from kirby3-simplestats.

Daandelange avatar Daandelange commented on June 3, 2024

That seems to be related to Kirby's PDO/SQLITE driver used by this plugin.
Maybe this thread can give you some directions. (look at phpinfo() if the PHP PDO SQLite3 module is enabled, and try to install that composer dependency)

from kirby3-simplestats.

JolinM avatar JolinM commented on June 3, 2024

I’ll need a bit more help to go through these steps; it is quite confusing for me.

  1. Add "ext-pdo_sqlite": "*" to my composer.json in the require block

We’re talking about the composer.json file located on the kirby folder, right?

  1. Run composer update to update the composer.lock file

I don’t know how to do that

  1. Deploy
    It’s already deployed if it’s on my remote (FTP) server, right?

from kirby3-simplestats.

Daandelange avatar Daandelange commented on June 3, 2024
  1. No, the one in the plugin folder.
    When you then run the composer update, it will update the plugin filles and make the necessary changes to integrate that extra dependency.
    So you might need to re-upload the plugin files after that. Refer to the Kirby Composer Guide for more detailed instructions.

from kirby3-simplestats.

JolinM avatar JolinM commented on June 3, 2024

Got it, thanks for the steps. Same error on my remote install :/

from kirby3-simplestats.

Daandelange avatar Daandelange commented on June 3, 2024

I've just updated the plugin, including a draft of a requirements checker in the Information tab (panel).
Could you check if all requirements are there ? Hopefully that gives a better insight.

from kirby3-simplestats.

JolinM avatar JolinM commented on June 3, 2024

Works great on the local instal. On the remote one, it shows nothing :(
Capture d’écran, le 2021-01-21 à 12 32 02

from kirby3-simplestats.

Daandelange avatar Daandelange commented on June 3, 2024

Does it show anything useful on website.domain/api/simplestats/listdbinfo?csrf=YOURTOKEN ? (you need to set the CSRF in your config.php : 'api.csrf' => 'YOURTOKEN',)

from kirby3-simplestats.

JolinM avatar JolinM commented on June 3, 2024

{"status":"error","message":"could not find driver","code":500,"key":null,"details":[]}

from kirby3-simplestats.

Daandelange avatar Daandelange commented on June 3, 2024

Hmm, ok, probably the Kirby\Database\Database class that doesn't work in your configuration.
I've made the requirements check "autonomous", so it should work now. Please check the message in the panel again, or website.domain/api/simplestats/checkrequirements?csrf=YOURTOKEN.

from kirby3-simplestats.

JolinM avatar JolinM commented on June 3, 2024

New error. the pop out when I open the page in the panel says
Return value of daandelange\SimpleStats\SimpleStatsDb::database() must be an instance of Kirby\Database\Database, null returned

Database Requirements says
PHP Extensions=Core, date, libxml, openssl, pcre, zlib, filter, hash, pcntl, readline, Reflection, SPL, session, standard, cgi-fcgi, bcmath, bz2, calendar, ctype, curl, dba, dom, mbstring, ftp, gd, gettext, iconv, imap, intl, json, ldap, exif, mysqlnd, odbc, PDO, pgsql, Phar, posix, shmop, SimpleXML, soap, sockets, sysvmsg, sysvsem, sysvshm, tidy, tokenizer, xml, xmlwriter, xsl, zip, mysqli, pdo_mysql, PDO_ODBC, pdo_pgsql, xmlreader, xmlrpc --- PHP=OK --- SQLite3=ERROR --- SQLite3.try=ERROR Class 'SQLite3' not found --- CreateDB()=ERROR:could not find driver --- pdo_sqlite=ERROR --- sqlite3=ERROR

And the url https://www.jolinmasson.com/api/simplestats/checkrequirements?csrf=COUCOU says
{"dbRequirements":"PHP Extensions=Core, date, libxml, openssl, pcre, zlib, filter, hash, pcntl, readline, Reflection, SPL, session, standard, cgi-fcgi, bcmath, bz2, calendar, ctype, curl, dba, dom, mbstring, ftp, gd, gettext, iconv, imap, intl, json, ldap, exif, mysqlnd, odbc, PDO, pgsql, Phar, posix, shmop, SimpleXML, soap, sockets, sysvmsg, sysvsem, sysvshm, tidy, tokenizer, xml, xmlwriter, xsl, zip, mysqli, pdo_mysql, PDO_ODBC, pdo_pgsql, xmlreader, xmlrpc --- PHP=OK --- SQLite3=ERROR --- SQLite3.try=ERROR Class 'SQLite3' not found --- CreateDB()=ERROR:could not find driver --- pdo_sqlite=ERROR --- sqlite3=ERROR"}

from kirby3-simplestats.

Daandelange avatar Daandelange commented on June 3, 2024

Ok, thanks, so that clarifies a lot. They say the same thing : Your php extensions sqlite3 (for SQLite3) and pdo_sqlite (used by Kirby\Database\Database) are not available. And they are at the core of this plugin. IMO, the easiest solution would be porting SimpleStats to optionally use MySQL databases (which seem to be enabled on your host) instead of SQLite3; but that is out of my scope... but I can give some directions for such changes if you wish.
Of course, a very simple solution would be to ask your hoster to enable them, or enable them yourself if you have access to custom php.ini or via your hoster's site admin panel. Or change your hoster.

from kirby3-simplestats.

JolinM avatar JolinM commented on June 3, 2024

My host replied me that! Does it help?

While checking through your concern, The sqlite3 is installed manually on the server.

Please check the same from your end,

++++++++++++++

root@golf [~]# sqlite3
SQLite version 3.6.20
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> 

from kirby3-simplestats.

JolinM avatar JolinM commented on June 3, 2024

I indeed ran the command in ter Remote terminal, and it does seams to be installed.
Capture d’écran, le 2021-01-28 à 18 02 40
My domain is a secondary domain on my host. Could that be what causes the problem?

from kirby3-simplestats.

JolinM avatar JolinM commented on June 3, 2024

They say it’s already installed 😑.
Capture d’écran, le 2021-01-29 à 14 08 14

from kirby3-simplestats.

Daandelange avatar Daandelange commented on June 3, 2024

Well, then something weird is happening on your host, it's not enabled on your Kirby installation.
In the panel's simplestats requirement check, the extensions that your Kirby php installation can use are listed after PHP Extensions=**your**extensions**, so then you might need to compare the output of php -m and the list in the panel. If they differ, your server setup is using a different PHP environment then the one in the console. Try creating an info.php (with <?php phpinfo(INFO_MODULES); ?>) file in your Kirby root and compare the extensions listed there.

from kirby3-simplestats.

JolinM avatar JolinM commented on June 3, 2024

Here’s my info.php
I tried to 'activate' sqlite by adding these three lines at the end of my php.ini, but it made my site crash (I have not a lot of clue about what I’m doing actually 😑).

extension=curl
extension=pdo_sqlite
extension=sqlite3

The output of the console and the site don’t match :/
SimpleStats output.txt
Terminal server.txt

from kirby3-simplestats.

Daandelange avatar Daandelange commented on June 3, 2024

Yes, that's the regular way to go. A crash means it doesn't accept your new lines it's very strict. Sometimes you need to add .so (or .dll on WIN). Try them one by one until it works, search online, or ask your hoster for support on how to enable it, read their FAQ.

from kirby3-simplestats.

JolinM avatar JolinM commented on June 3, 2024

Ooooof, I asked to activate the extension… so they switched my PHP to 5.6, breaking my site in the process. 😑 I asked a second time, and they reverted to 7.3 and activated the extension. It now works like a charm!

Geez, that was not so complicated, and entirely on their end. Thanks a lot Daandelange for the support during all this process!

from kirby3-simplestats.

JolinM avatar JolinM commented on June 3, 2024

Hey Maandenlange, I think I’m cursed. I did a clean install of the plugin + database last weekend, now that I have the requirements.
I used a VPN to visit my website, see if it worked, and 48 hours, I still have no stats 😭.
Any clue?
Capture d’écran, le 2021-02-09 à 17 51 54

from kirby3-simplestats.

Daandelange avatar Daandelange commented on June 3, 2024

Hey Jolin, I guess that you're not connected to the panel using your VPN ?
Is the logfile empty ? Did you try deleting the db file and let it create a new one ? (looks like it's already the case, but you never know...)
Don't bother waiting 24/48H : If there's nothing in this view ( cf: No rows available), nothing will appear later.
Did you try if referrer tracking works (instantly appears) ?
Any other clue... try disabling the Kirby cache or other settings that could affect tracking ? (Try a clean plainkit/starterkit on your configuration?)

from kirby3-simplestats.

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.