This is a function used to work with the command line. So, probably the hosting server you're using is blocking it for security reasons.
You will have to ask the support to release this function in php.ini or migrate your plan to have the privilege of being able to use this function.
On-premises works normally because there are no restrictions on using escapeshellarg
on your php.ini
.
Another thing that can be done (depending on your hosting plan) is to remove this function from the list of functions present on the line where disabled_functions
is in php.ini
.
It seems that there is still another possibility: If php is running in safe mode
, those functions that working with processes and command line are disabled.