Duplicate module ini files cause PHP startup warnings

#1
On a fresh install of LSWS & LSPHP, the module directory has files with duplicate content, which causes PHP Warning: Module XYZ already loaded errors in the output.

Code:
$ ls -1 /usr/local/lsws/lsphp72/etc/php/7.2/mods-available
10-opcache.ini
20-curl.ini
20-intl.ini
20-json.ini
20-mysqli.ini
20-pdo_mysql.ini
curl.ini
intl.ini
json.ini
mysqli.ini
opcache.ini
pdo_mysql.ini
This is especially annoying when running cli PHP cron jobs, with the same binary the web server uses, which causes the output to be logged as an error. Removing the non-number-prefixed copies resolved my issue for now.
 
#3
I'm not sure if you fixing this is what caused my issue, but I upgraded to 5.3.3 and it emptied my /usr/local/lsws/lsphp72/etc/php/7.2/mods-available/ directory completely, which took down several sites across 2 servers. I resolved it by creating symlinks in that dir to the various .ini files under /usr/local/lsws/lsphp72/share/

Is that safe? I don't want my config to be knocked out again. I don't see any analogue to phpenmod that would do this formally.
 
Last edited by a moderator:

Jon K

Administrator
Staff member
#4
Hello Roy,

How did you upgrade to 5.3.3? During the upgrade to 5.3.3 it should not have touched any .ini files.
 
#6
Yeah, I'm pretty convinced this was LSWS's fault. Just installed lsphp on another server and the ini files that appeared in /usr/local/lsws/lsphp72/etc/php/7.2/mods-available were the unprefixed ones, and they were copies, not symlinks to the ones under /usr/local/lsws/lsphp72/share/. So I think LSWS saw the prefixed ones, and assumed they were the duplicates it created prior and deleted them, without realising the unprefixed ones were gone.
 
Top