• Resolved fwiep

    (@fwiep)


    Hello,
    Using BackWPup v4.0.0 on WordPress 6.2.2 under PHP 8.2 in a shared hosting environment. When running a full backup (including all files), I receive the warning “WARNING: Trying to access array offset on value of type bool” a total of 11140 times in a row. The backup succeeds, but the log is massive.

    I know there is an exact same thread in this forum, but that has been closed and I cannot reopen or respond to it. Hence me starting a new thread and posing the same question, only 2,5 years later.

    Will BackWPup be made compatible with PHP 8.2 and WordPress 6.2.2? If not, how can I prevent the warnings?

    Thanks,
    FWieP

    • This topic was modified 1 year, 7 months ago by fwiep.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support happyAnt

    (@duongcuong96)

    @fwiep

    I’m currently running PHP 8.2 with the latest BWU 4.0 and WP 6.2 and there are no warnings or any issues happening.

    View post on imgur.com

    Could you please check if the issue is caused because of plugin conflicts?

    For troubleshooting the issue, you can try disabling all other plugins except BackWPUp and run the job again.

    • This reply was modified 1 year, 7 months ago by happyAnt.
    Thread Starter fwiep

    (@fwiep)

    Hi, thanks for your reply.

    I have disabled all other plugins and ran the Job ‘dataabase only’. It still generates 6 warnings.

    This is the system info:
    screenshot of info
    I see the same PHP, WordPress and plugin versions.

    This is the logfile of this job:
    logfile

    Is there anything else I can try?
    FWieP

    Thread Starter fwiep

    (@fwiep)

    Hello again.

    I have followed in your footsteps and installed a clean WordPress with your plugin on a local test machine using PHP 8.2.

    You are correct: there are no warnings during execution or in the logs. The warnings I get in the original post, I will have to debug myself on that specific shared hosting server… ??

    Thanks for your effort and support,
    FWieP

    Thread Starter fwiep

    (@fwiep)

    Hello again,

    Having debugged the issue on the shared hosting, I have discovered the following. In the plugin’s class-create-archive.php, there is a function called posix_getpwuid(). It translates a file’s UID and GID to their corresponding names.

    On this shared hosting, the first part (call to posix_getpwuid()) succeeds, but the second part (call to posix_getgrgid()) fails and returns FALSE. Therefore the following statement $group = $info['name']; fails with the original error: “Trying to access array offset on value of type bool”. Now that finally makes sense ?? .

    I propose to safeguard against this possibility by rewriting the calls like this:

    if (function_exists('posix_getpwuid') && ($info = posix_getpwuid($uid))) {
        $owner = $info['name'];
    }
    if (function_exists('posix_getgrgid') && ($info = posix_getgrgid($gid))) {
        $group = $info['name'];
    }

    Would you please consider adding this safeguard to the plugin’s official source code?

    Thanks,
    FWieP

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘BackWPup – Trying to access array offset on value of type bool since PHP 8.2’ is closed to new replies.