If you get a sqlite3 error when switching from php 8.x to php 7.4 like undefined reference to 'sqlite3_ you can try and install a newer version of sqlite3:
cd /usr/local/src
wget https://www.sqlite.org/2022/sqlite-autoconf-3370200.tar.gz
tar xvfz sqlite-autoconf-3370200.tar.gz
cd sqlite-autoconf-3370200.tar.gz
CFLAGS="-DSQLITE_ENABLE_COLUMN_METADATA=1" ./configure
make & make install