В фантомном разрешении отказано - PullRequest
0 голосов
/ 04 июля 2018

У меня есть вопрос, и я чувствую, что его не должно быть трудно решить, но я не очень знаком с Phantom Js.

$this->phantomProcess($path)->setTimeout(10)->mustRun();

Эта строка приводит к следующей ошибке:

protected function captureImage($view)
{
    $path = $this->writeFile($view);

    $this->phantomProcess($path)->setTimeout(10)->mustRun();

    return $path;
}

protected function writeFile($view)
{
    file_put_contents($path = 'storage/' . md5(uniqid()) . '.pdf' , $view);

    return $path;
}

protected function phantomProcess($path)
{
    return new Process('bin/phantomjs capture.js ' . $path);
}

Я запускаю следующую строку:

Fatal error: Uncaught exception 'Symfony\Component\Process\Exception\ProcessFailedException' with message 'The command "bin/phantomjs capture.js storage/7c5b791a0c1f131aac5c5ca272a1c891.pdf" failed. Exit Code: 126(Invoked command cannot execute) Working directory: /Applications/XAMPP/xamppfiles/htdocs/pdf Output: ================ Error Output: ================ sh: bin/phantomjs: cannot execute binary file ' in /Applications/XAMPP/xamppfiles/htdocs/pdf/vendor/symfony/process/Process.php:239 Stack trace: #0 /Applications/XAMPP/xamppfiles/htdocs/pdf/app/Codecourse/Capture/Capture.php(45): Symfony\Component\Process\Process->mustRun() #1 /Applications/XAMPP/xamppfiles/htdocs/pdf/app/Codecourse/Capture/Capture.php(24): Codecourse\Capture\Capture->captureImage('<!DOCTYPE html>...') #2 /Applications/XAMPP/xamppfiles/htdocs/pdf/index.php(17): Codecourse\Capture\Capture->load('invoice.php', Array) #3 {main} thrown in /Applications/XAMPP/xamppfiles/htdocs/pdf/vendor/symfony/process/Process.php on line 239

Кто-нибудь может мне помочь? Действительно ценится,

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...