Home>

I am trying to install wkhtmltopdf in a web application that is being created with Laravel in order to provide a function to convert the display screen to PDF.
Although it behaves as expected in the local environment (Windows),
When it was raised to the test server (FreeBSD), it stopped working.
I sayExec format error, but I don't know what to do.

composer.json has the following description:"barryvdh/laravel-snappy" ;:"^ 0.4.1"

After logging in with SSH,
$/usr/local/bin/wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz --no-check -certificate
$tar -xf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz

DL/decompressed according to the procedure of

.

Problems/Error messages i am experiencing
The exit status code '126' says something went wrong: stderr: "/ usr/home/username/wkhtmltox/bin/wkhtmltopdf: Exec format error" stdout: "" command:/usr/home/username/wkhtmltox/bin/wkhtmltopdf --lowquality --margin-bottom '10' --margin-left '10' --margin-right '10' --margin-top '10' --disable-smart-shrinking- footer-font-name 'Meiryo' --footer-right 'Output date: [date]' '/tmp/knp_snappy5b0ca837551e12.83193103.html' '/tmp/knp_snappy5b0ca8375524a5.78258254.pdf'.
source code:

config/snappy.php

<? php

if (app ()->isLocal ()) {
    return array (

        'pdf' =>array (
            'enabled' =>true,
            'binary' =>base_path ('vendor/wemersonjanuario/wkhtmltopdf-windows/bin/64bit/wkhtmltopdf.exe'),
            'timeout' =>false,
            'options' =>array (),
            'env' =>array (),
        ),
        'image' =>array (
            'enabled' =>true,
            'binary' =>base_path ('vendor/wemersonjanuario/wkhtmltopdf-windows/bin/64bit/wkhtmltoimage.exe'),
            'timeout' =>false,
            'options' =>array (),
            'env' =>array (),
        ),

    );
} else {
    return array (

        'pdf' =>array (
            'enabled' =>true,
            'binary' =>'/ usr/home/username/wkhtmltox/bin/wkhtmltopdf',
            'timeout' =>false,
            'options' =>array (),
            'env' =>array (),
        ),
        'image' =>array (
            'enabled' =>true,
            'binary' =>'/ usr/home/username/wkhtmltox/bin/wkhtmltoimage',
            'timeout' =>false,
            'options' =>array (),
            'env' =>array (),
        ),

    );
}
Additional information (FW/tool version, etc.)

Laravel 5.6.3
Windows 10
FreeBSD 10.4
* Both local and test seem to be 64bit