I'm REALLY close to having PHP and SQL playing nice with each other. My previous problem turned out to be that my PHP script was logging into SQL as 'pi'@'localhost", rather than 'pi'@'127'0.0.1'. The former has worked perfectly for years on Debian Linux, but I can live with this, since SQL only needs to be accessible from the one system.
But, after making the above change, when I run any PHP script that accesses the mysql database, it throws the error "could not open /dev/crypto", unless the script is run by root. With the previous versions of PHP/SQL I've run under Debian Linux, I only needed to install mysqli. But, to get php8-mod-mysqli working on OpenWRT, I MUST also install php8-mod-mysqlnd which in turn installs php8-mod-openssl. I suspect this error is a result of the openssl install, but it MUST be there for mysqli to work. I assume it is some simple permissions issue, but I have been unable to resolve it in an acceptable manner. As I said, it works fine for the root user, but not for any normal user. So, I changed permissions on /dev/crypto to a+rw, and it now works for everyone, but I suspect that is not good from a security perspective. Surely there is a better way?