1

Why do I have to activate the PHP functions: "proc_open" and "proc_close" to backup the database?

I got the error logs:

[error][yii\base\Exception] yii\base\Exception: Could not create backup: proc_open() has been disabled for security reasons in /home/velolade/craft3veloladen_daten/vendor/craftcms/cms/src/controllers/UtilitiesController.php:383

[error][yii\base\Exception] yii\base\Exception: Could not create backup: proc_close() has been disabled for security reasons in /home/velolade/craft3veloladen_daten/vendor/craftcms/cms/src/controllers/UtilitiesController.php:383

After activating these functions in my hoster's PHP settings, it worked. Is this a security problem for my website?

Thank you very much!

1 Answer 1

2

Craft uses MySQL's native mysqldump and PostgreSQL's pg_dump binaries to create database backups.

In order for PHP to be able to execute those binaries, it needs to be able to run the proc_open and proc_close PHP commands.

I would not consider it a security issue, but if you were really concerned about it, you can prevent Craft from making backups on update and/or specify your own backup logic bypassing Craft's default implementation.

4
  • How did Craft 2 do it? Craft 2 worked flawlessly with openbasedir, Craft 3 does not.
    – Anders
    Sep 26, 2018 at 20:10
  • Not sure what this post has to do with openbasedir?
    – Brad Bell
    Oct 5, 2018 at 22:04
  • openbasedir disables proc_open(), no? That seems to be how shared hosting typically works in any case.
    – Anders
    Oct 6, 2018 at 1:46
  • Ahh, a host that might use openbase_dir, might also happen to disable some proc_ methods, but they are technically unrelated.
    – Brad Bell
    Oct 6, 2018 at 8:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.