Score:-1

After upgrade to Drupal 9.2: Call to undefined function escapeshellcmd(). Why?

kp flag

When I want to submit a form (webform module) I get get the followng error:

Call to undefined function Drupal\Core\Mail\Plugin\Mail\escapeshellcmd() in Drupal\Core\Mail\Plugin\Mail\PhpMail::_isShellSafe() (line 165 of core/lib/Drupal/Core/Mail/Plugin/Mail/PhpMail.php).

This error disappears if I remove all mails in "/admin/structure/webform/manage/MY-FORM/handlers".

This error occurs also using simplenews module by trying to subscribe to a newsletter.

Score:4
fr flag

escapeshellcmd() is a built-in PHP function, and should always be found. It evidently can't be found in the global namespace on your system, so PHP falls back to looking for it in the current namespace where it is being called, which is \Drupal\Core\Mail\Plugin\Mail\escapeshellcmd(). And obviously it won't be found there either, which is why you get the error.

Try php --info and search for the disable_functions setting to see if someone turned off use of escapeshellcmd() on your system. That seems the only likely possibility. Or better yet search for the disable_functions setting at /admin/reports/status/php since that will show the settings for the version of PHP that your webserver is using.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.