binary does not exist; binary does not exist in laravel, If you are getting this error while you working with the "anam/phantommagick" package in laravel for the convert pdf to image file or any other development, That time you get this type of error.
The reason for this error is, You not getting a binary path for the execute command line from your laravel application, So in this case, we need to define a binary path ourselves.
First, we will download the exe file from the official site link below given in the step just download a file from there and give a path to the binary method.
Download Extension
First, We will download the extension file from the below-given link, Just click on the below link you will redirect to the download page. Then after downloading suitable your system from there. Download PhantomJS After downloaded, put any of directory of your system. and copy file path inside the bin folder.
Error : You need to install the imagick extension to use this back end
Install Composer (If Not Installed)
composer require anam/phantommagick
Give Binary Path
Give your binary path to your "Converter" class using the "setBinary" method, inside.
In my case my "phantomjs.exe" file is inside my c drive, So I given that path.
$conv = new \Anam\PhantomMagick\Converter(); $conv->setBinary('C:\phantomjs-2.1.1-windows\phantomjs-2.1.1-windows\bin\phantomjs.exe');
You can also put that exe file inside your project and give a path something like the below-given example.
$conv = new \Anam\PhantomMagick\Converter(); $conv->make('https://webappfix.com') ->setBinary(base_path() . "/phantomjs-2.0.0-windows/bin/phantomjs.exe") ->toPdf() ->download('google.pdf');
We always thanks to you for reading our blogs.
![dharmesh-image](/storage/site-setting/w4q23X3ihxZ9MQ5o4GeFthb0mqCcg4LgG8sIqigI.png)
Dharmesh Chauhan
(Swapinfoway Founder)Hello Sir, We are brothers origin from Gujarat India, Fullstack developers working together since 2016. We have lots of skills in web development in different technologies here I mention PHP, Laravel, Javascript, Vuejs, Ajax, API, Payment Gateway Integration, Database, HTML5, CSS3, and Server Administration. So you need our service Please Contact Us
![haresh-image](/storage/site-setting/uESEBDJrsDNffCSc0uNtilcThH7Y0df7oI93WCPP.png)
Haresh Chauhan
(Co-Founder)We Are Also Recommending You :
- Laravel Zaakpay Payment Gateway Integration Tutorial Example
- How to Generate PDF File Using DomPDF In Laravel 9 Example
- Import Export Database in JSON Format Laravel
- Laravel 9 Dropzone Multiple File Upload Example
- Laravel 10 Firebase Web Push Notification Tutorial
- How To Integrate Stripe Payment Gateway in Laravel 9
- Upayments Gateway Integration PHP - Laravel
- Laravel 10 Create Controller Example
- Arr::forget() | Laravel Helper Function
- Laravel Country State City Dropdown Using AJAX