phantommagick
phantommagick copied to clipboard
Binary does not exist
I can use phantommagick in local server but when I upload my laravel project to my server;
Converter::make($html) ->toPng() ->download('teklif.png');
is return me "binary does not exist". Please help
@meliksahk are you using anam/phantomjs-linux-x86-binary
? if not please read the following:
https://github.com/anam-hossain/phantommagick#binary
yes I m using anam/phantomjs-linux-x86-binary. Also I tried setBinary
2016-02-13 15:06 GMT+02:00 Anam Hossain [email protected]:
@meliksahk https://github.com/meliksahk are you using anam/phantomjs-linux-x86-binary? if not please read the following:
https://github.com/anam-hossain/phantommagick#binary
— Reply to this email directly or view it on GitHub https://github.com/anam-hossain/phantommagick/issues/10#issuecomment-183662336 .
Melikşah Said KUTLU Yazılım Projeleri Sorumlusu *EMATO ELEKTRONİK *
I have also experienced this problem, but I fix it by making the binary file (phantomjs) executable, I'm using vagrant with ubuntu 14.04
Hi, same problem
I've also set path in this way
use
Anam\PhantomLinux\Path;
->setBinary(Path::binaryPath())`
phantomjs has 755 permission I've installed it with composer
I fix the problem
I've installated phantomjs on Centos7 in /user/bin/phantomjs
Change these line in Runner.php
// if (! shell_exec(escapeshellcmd("which {$binary}"))) { // return false; // } if (! shell_exec(escapeshellcmd("{$binary}"))) { // echo 'no linux3'; return false; }
And set the new Binary
->setBinary('/usr/bin/phantomjs')
I installed phantomjs and now I am getting a pdf, but none of my local fonts are rendering. Is there really no way to get this working without loading in a different package of phantomjs?
Same issue. Are you fixed the issue?
I found that my code does not work in one server but it does in others with the same settings. Centos 7 with WHM/cpanel
The following function does not return true in Runner.php
if (! shell_exec(escapeshellcmd("which {$binary}"))) {
return false;
}
Commenting the line returning false makes it work, because the binary exists and it is located properly.
So it looks like this issue has to be with something executing shell_exec or escapeshellcmd via laravelm, what could it be? using php-fpm these functions are enable and the user is in the wheel group as well.
Thanks for your help
Hi,
I'm also having the same problem, I'm using Laravel 5.7 in windows 10. I first installed via composer:
composer require josh/laravel-phantomjs then composer require anam/phantommagick after it I added the lines to the aliases and facades. and when I call this code:
$conv = new \Anam\PhantomMagick\Converter();
$conv->source('http://google.com')
->toPdf()
->save('/your/destination/path/google.pdf');
I get an error: "Binary does not exist" in \vendor\anam\phantommagick\src\Runner.php
public function pickBinary()
{
if ($this->binary != 'phantomjs') {
if (! $this->verifyBinary($this->binary)) {
throw new Exception('Binary does not exist');
}
return $this->binary;
}
if (! $this->verifyBinary($this->binary)) {
if (! $this->verifyBinary($this->getAlternateBinary())) {
throw new Exception('Binary does not exist');
}
$this->binary = $this->getAlternateBinary();
}
return $this->binary;
}
How can I fix it?
change binary file permission to 777