docker-machine里面的Symfony进程

我有Laravel 5.2,并尝试做这样的事情

namespace App\Jobs; use App\Jobs\Job; use Illuminate\Queue\SerializesModels; use Illuminate\Queue\InteractsWithQueue; use Illuminate\Contracts\Queue\ShouldQueue; use Symfony\Component\Process\Process; use Symfony\Component\Process\Exception\ProcessFailedException; class MachineCreate extends Job implements ShouldQueue { use InteractsWithQueue, SerializesModels; /** * Create a new job instance. * */ public function __construct() { // } /** * Execute the job. * */ public function handle() { $process = new Process('docker-machine create --driver digitalocean --digitalocean-access-token *** do-test'); $process->setTimeout(600); $process->run(); // executes after the command finishes if (!$process->isSuccessful()) { throw new ProcessFailedException($process); } } } 

每当我这样做,我有错误:

 Driver "digitalocean" not found. Do you have the plugin binary accessible in your PATH? 

但是,如果我在php artisan tinker做同样我没有错误,everething工作正常。

任何想法我做错了什么?

我通过使用ProcessBulder解决了这个问题

 $builder->setPrefix('/usr/local/bin/docker-machine'); $process = $builder ->setArguments(array( 'create', '--driver', 'digitalocean', '--digitalocean-access-token', '***', 'do-test')) ->getProcess(); $process->run(); 

但是,我不知道这个问题的原因是什么…