Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP8 issue: disk_free_space() generates fatal error at some webhosts - please add function_exists() #1213

Open
canufarm opened this issue Jun 3, 2022 · 2 comments

Comments

@canufarm
Copy link

canufarm commented Jun 3, 2022

Hi,

if a webhost excludes the function disk_free_space() in his PHP-settings because of security, backupwordpress crashes, because since PHP8 "@" does not longer suppress fatal errors.

So if the webhost has set
disable_functions="diskfreespace, disk_free_space"
backupwordpress will no longer work. Please always check, if the function disk_free_space() exists before use, because a lot of webhosts do not allow this function.

Thanks.

@nicomollet
Copy link

Same problem here on Kinsta hosting, with PHP 8.0.

@uaibo
Copy link

uaibo commented Oct 17, 2022

I can confirm, the site breaks from this fatal error after switching to PHP8.0 (on Kinsta)

Fatal error: Uncaught Error: Call to undefined function HM\BackUpWordPress\disk_free_space()

in /wp-content/plugins/backupwordpress/functions/interface.php on line 498

I have temporarily fixed it by checking the function exists but you need to find a permanent fix on the next update so that it doesn't break sites.

if( !function_exists('@disk_free_space') ){
    return false;
}

BackupWordpress version: 3.13
PHP version: 8.0.24
Platform: Kinsta

(update): Confirmed, these functions are disabled on Kinsta:

exec, passthru, shell_exec, system, proc_open, popen, show_source, apache_child_terminate, apache_get_modules, apache_get_version, apache_getenv, apache_note, apache_setenv, posix_kill, posix_mkfifo, posix_setpgid, posix_setsid, posix_setuid, posix_getpwuid, posix_uname, pclose, dl, disk_free_space, diskfreespace, disk_total_space, pcntl_exec, proc_close, proc_get_status, proc_nice, proc_terminate, symlink, link, pcntl_alarm, pcntl_fork, pcntl_waitpid, pcntl_wait, pcntl_wifexited, pcntl_wifstopped, pcntl_wifsignaled, pcntl_wexitstatus, pcntl_wtermsig, pcntl_wstopsig, pcntl_signal, pcntl_signal_dispatch, pcntl_get_last_error, pcntl_strerror, pcntl_sigprocmask, pcntl_sigwaitinfo, pcntl_sigtimedwait, pcntl_exec, pcntl_getpriority, pcntl_setpriority, highlight_file, lchgrp, lchown, prog_get_status, getmypid, getmyuid, getmygid, getrusage, getmyinode, get_current_user, libxml_disable_entity_loader

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants