[HttpFoundation] Check if required shell functions are not disabled

Rebased to `2.0` & squashed version of #6526.