SQLite in PHP7.4 - trying to activate it, but the site still doesn't load

SYSTEM INFORMATION
OS type and version Ubuntu Linux 20.04.4
Virtualmin version 6.17-3

Hello… it’s me again…
I’ve been trying to set up my website, which is using sqlite, but i can’t make it work, it loads but it stop after some time with this error:

Stack trace:
#0 /home/meduzzaworld/domains/pvm.meduzza.world/public_html/include/functions/basic.php(2176): USER->runQuerySqlite()
#1 /home/meduzzaworld/domains/pvm.meduzza.world/public_html/index.php(110): getLast3Posts()
#2 {main}
  thrown in /home/meduzzaworld/domains/pvm.meduzza.world/public_html/include/classes/user.php on line 53" while reading response header from upstream, client: xxx, server: pvm.meduzza.world, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/php-nginx/164546190977100.sock/socket:", host: "pvm.meduzza.world"
2022/02/21 21:19:35 [error] 105808#105808: *110 open() "/home/meduzzaworld/domains/pvm.meduzza.world/public_html/images/logo.png" failed (2: No such file or directory), client: xxxx, server: pvm.meduzza.world, request: "GET /images/logo.png HTTP/1.1", host: "pvm.meduzza.world", referrer: "https://pvm.meduzza.world/css/style.css"

It is about SQLite as it says in the error, i’ve been trying with

sudo apt-get update
sudo apt-get install php-sqlite3

but nothing…
even with:
image

I don’t know how can i activate every extension that i need for php, for the ENTIRE domain (if it is possible) or for a specific subdomain/domain only…

To my limited knowledge of it, SQLite is self contained. It’s not a server based SQL software. You have to have an app to embed and utilize SQLite. It’s not something you install on a server and run. That’s MySQL / MariaDB.

2 Likes

Then, what could be the problem ? I specify that my website worked well on another host. But now it doesn’t continue to execute the code after USER->runQuerySqlite()

Has it ever worked, if so when did it stop. Database and user with correct permissions? Did you install extensions for the specific php versions or have multiple versions?

As an example for php7.4

sudo apt update
sudo apt install php7.4
sudo apt install php7.4-common php7.4-mysql php7.4-xml php7.4-xmlrpc php7.4-curl php7.4-gd php7.4-imagick php7.4-cli php7.4-dev php7.4-imap php7.4-mbstring php7.4-opcache php7.4-soap php7.4-zip php7.4-intl -y

1 Like

I suspect you have a permission issue with the user being able to alter databases.

Hi @itslime ,

I can see the error log you posted. I had same problem on my mediawiki install - basically you have to have php7.3 etc to be able run that app, which I had so I install some php add-on I normally use on my server (as @Whoops suggested). Then I installed some stupid plugin and my private wiki whent down, then from apache error logs I found that that plugin wast like the php version 7… code was so outdated that it was incompatible with my server setup.

In mean time your error log said that sqlite have some problem thanks on php (some-line-number) like .../index.php(110): g... or ...lasses/user.php on line 53"... so I would say the problem is the app it self or you missing some php add on.

Regards fetching logo error - that is definitely issue with your php script which might worked on older version of php but might not work any more on php 7.4 which brings me back that you should really check your app code if its compatible with 7.4 or higher

Also check with your previous hosting - what php versions they run on their servers, perhaps you will found the answer there right a way.

and @Whoops, just side note for you, I would suggest to just short or simplified version of your command - if I can :wink:

Its one line perhaps you can add any other php add-on you could think of.

apt install php7.4 libapache2-mod-php7.4 libapache2-mod-fcgid php-memcache php-memcached imagemagick php7.4-{cli,common,pdo,fpm,zip,gd,xml,mysql,cgi,mbstring,intl,apcu,curl,amqp,json,opcache,readline,xmlrpc,xsl,tidy,sqlite3,snmp,recode,pspell,odbc,mcrypt,ldap,imap,imagick,dev} -y
1 Like

Hello again! Thank you for your complex answers. As I’ve said, my other webhost was running cPanel with 7.4 native (means i can’t modify extensions, but i can switch to 7.4 normal and select what i want)

When i try to run what @unborn said, it gives me this error:

@Whoops It didnt worked before on Virtualmin, that made me run a fresh install (thought i’ve damaged something while installing, but i don’t think so).
I am using a root user, as i’m managing all my domains.
Yes, I’ve installed the main extensions, as I’ve said earlier… having native version (on the webhost with cPanel) worked fine :frowning:

@stuckinthehouse i don’t think that the permissions are making jokes with me. As @Gomez_Adams said, yes, SQLite is self contained.

These are my settings in Features and Plugins.

Hi, thanks for pointless logins - please ask your previous host what php they was running? question remind… saying native sql etc means nothing as you are native to sourcecode - please come back with relevant reply. thanks.

Edit: I can see from screenshots that you cannot locate any php7.4… install php 7.3 then…

1 Like

Sorry for that. Sorry for taking your personal time because of my tag. I don’t want to bother anyone, you’re not obeyed to answer me…

Right now i solved it, based on some google searches (based on what you guys said to me), some apt update & upgrade

This is what i’ve run:

apt install software-properties-common # (it was missing)
add-apt-repository ppa:ondrej/php && apt-get update
apt-get install php8.0-{cli,pdo,fpm,zip,gd,xml,mysql,cgi}
apt-get install php7.3-{cli,pdo,fpm,zip,gd,xml,mysql,cgi}
sudo apt update
sudo apt upgrade

Then went into my subdomain Server configurationPHP Options and checked it like this:

Thank you for your time and patience!

Source: Multiple PHP Versions – Virtualmin

it was resolved already…

This is a bit disturbing to have this very basic package missing on the default installation.

1 Like

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.