I installed XOOPS 2.5.11 on PHP 8.2.27 and also on PHP 8.4, and couldn't replicate the error.
This error happens normally when you want to open a file using
fopen()
do something, and then want to write the results to the file using
fwrite()
When the file couldn't be open in the first place, then fopen() will be false, and you will get your error when you try to write to that file
So you would need to place a check for false before you fwrite()
In code like this:
$fp = @fopen($protector->get_filepath4group1ips(), 'w');
if ($fp) {
@flock($fp, LOCK_EX);
fwrite($fp, serialize(array_unique($group1_ips)) . "n");
@flock($fp, LOCK_UN);
fclose($fp);
} else {
$error_msg .= _AM_MSG_GROUP1IPSCANTOPEN;
}
you could check for false:
$fp = @fopen($protector->get_filepath4group1ips(), 'w');
if (false !== $fp) {
or you could check for false and use Exception:
$fp = @fopen($protector->get_filepath4group1ips(), 'w');
if ($fp === false) {
throw new FileOpenException("Failed to open file for writing: $filePath (mode: 'w')");
}
Try one by one for the all the fwrite() cases within /xoops_lib/modules/publisher, and see if that helps to identify the issue.
Let us know if that helped to identify the issue.
Also, if I remember correctly, somebody said that there were some problems with an installation provided by the ISP, so you might download the full XOOPS 2.5.11 and reinstall it.
If this is a testing site, you might also download the
Beta of XOOPS 2.5.12 and see if the problem is still there.