DEV Community

CastroMatavele
CastroMatavele

Posted on

Hellp Guys please

Hellp, I host my app on cpanal and now I am having this error, I used to send emails but now is giving this error

"proc_open() has been disabled for security reasons"

private function establishProcessConnection()
{
    $command = $this->params['command'];
    $descriptorSpec = [
        0 => ['pipe', 'r'],
        1 => ['pipe', 'w'],
        2 => ['pipe', 'w'],
        ];
    $pipes = [];
    $this->stream = proc_open($command, $descriptorSpec, $pipes);
    stream_set_blocking($pipes[2], 0);
    if ($err = stream_get_contents($pipes[2])) {
        throw new Swift_TransportException(
            'Process could not be started ['.$err.']'
            );
    }
    $this->in = &$pipes[0];
    $this->out = &$pipes[1];
}

private function getReadConnectionDescription()
{
    switch ($this->params['type']) {
        case self::TYPE_PROCESS:
            return 'Process '.$this->params['command'];

Top comments (2)

Collapse
 
nerkmind profile image
Lewis Clarke • Edited

Unfortunately there is no way around this, you need to contact your hosting company and ask them very nicely to enable it. If they are unwilling to do this honestly you're better off buying a vps or dedicated server for hosting your own apps.

to be honest, I doubt they will enable it due to the nature of what it does.

Collapse
 
msamgan profile image
Mohammed Samgan Khan

it's not your fault, contact to your server admin and get it enabled.