sebastianfeldmann / phpbu

PHP Backup Utility - Creates and encrypts database and file backups, syncs your backups to other servers or cloud services and assists you monitor your backup process
https://phpbu.de
Other
1.3k stars 110 forks source link

is_executable(): open_basedir restriction in effect #308

Open oliversum-ch opened 3 years ago

oliversum-ch commented 3 years ago

Hey Sebastian Thanks for creating PHPBU! I'm using it on shared hosting. It works very well when using it via command line, but I get this error when using it via a cron job:

Warning: is_executable(): open_basedir restriction in effect. File(/bin/bzip2) is not within the allowed path(s): [...]

I assume that phpbu is checking if bzip2 is installed, but I don't have access to /bin/. Is it possible to deactivate this check? Thank you very much!

sebastianfeldmann commented 3 years ago

Currently you can't specify the path to the compressor binaries. But how does it work if you run it on the command line? You can check which bzip2 binary you use on the terminal by running $ which bzip2 It looks like your cron environment is different to your command line environment.

If you know where your binaries are located I could add an option to the configuration to add directories to look for the binaries.

oliversum-ch commented 3 years ago

Thanks for your reply! Agree, it looks like the corn and cli environment are different.

Mhm, I get an error:

$ which bzip2
-jail: which: command not found

But according to my hoster, the path to bzip2 is correct (/bin/bzip2). They just recommend deactivating the is_executable() test, as I don't have access to /bin/.

sebastianfeldmann commented 3 years ago

Ah ok that somehow makes sense. It still doesn't explain why it works in your environment and not in that of your cron user 🤔