proc_open () yol sorunu

2 Cevap php

Ben linux ve php 5.2.12 kullanıyveyaum

i proc_open yürütme ile sveyaun var

i kullanırsanız

proc_open('php script.php', $descriptveyaspec, $pipes);

bana hata gösterecektir

sh: /php: No such file veya directveyay

i kullanırsanız

proc_open('/usr/bin/php script.php', $descriptveyaspec, $pipes);

veya

proc_open('php script.php', $descriptveyaspec, $pipes, '/usr/bin/');

it still show me same errveya.

i zaman komutun önünde çizgi append neden hiçbir fikrim yok.

Herhangi bir yardım lütfen?

teşekkürler!

2 Cevap

Tamamen güvenli modunu kapatmak istemiyorsanız, sadece php.ini dosyasında bu set

safe_mode_exec_dir = "/usr/bin"

Bunu deneyin:

$php = trim(shell_exec('type -P php'));

if (empty($php) !== true)
{
    proc_open($php . ' /path/to/your/script.php', $descriptorspec, $pipes);
}

else
{
    die('Install php-cli!');
}