A Debian server has a standard systemd service unit installed: phpsessionclean.
It is called every 30', invoking the shell script
/usr/lib/php/sessionclean, which in turn invokes a small inline php script, using the cli SAPI.
This execution issues the following warning every 30':
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/oci8.so' - libmql1.so: cannot open shared object file: No such file or directory in Unknown on line 0
Besides, no such warnings are issued when it is a cron job that invokes php scripts in general.
I can confirm the oci8 module is loaded when I run
php -c <path to INI file> -m | grep oci8.
I tried to set
ORACLE_HOME to the relevant path inside
/usr/lib/php/sessionclean, but that wouldn't do. However, I used to obtain equivalent warnings, even through crontab jobs, at the time when I hadn't set these environment variables at the top of the crontab. This to say that it looks like the Oracle environment is not loaded when the PHP script is run from the systemd mechanism.
My question: how to make the systemd-invoked PHP script aware of the Oracle environment?