snappdf icon indicating copy to clipboard operation
snappdf copied to clipboard

Error on Ubuntu 24.04.1 LTS

Open OlyaK95 opened this issue 1 month ago • 10 comments

I have no problem on local Windows 11 Laragon server and have some problems on production Ubuntu 24.04.1 LTS server.

My Laravel code looks like this:

$snappdf = new \Beganovich\Snappdf\Snappdf();

$html = view("cables-with-data", [
    "data" => $format,
    "cables" => $cables,
])->render();

if (env("APP_ENV") === "local") {
    $snappdf
        ->setHtml($html)
        ->setChromiumPath(
            "D:\\laragon\\www\\formats\\vendor\\beganovich\\snappdf\\versions\\1409080-Win_x64\\chrome-win\\chrome.exe"
        )
        ->save(public_path("cables.pdf"));
 } elseif (env("APP_ENV") === "production") {
    $snappdf
        ->setHtml($html)
        ->setChromiumPath(
            "/var/www/html/formats/vendor/beganovich/snappdf/versions/1409252-Linux_x64/chrome-linux/chrome"
        )
        ->save(public_path("cables.pdf"));
}

Error on Linux is The process has been signaled with signal "6".

Then I tried command line interface and get some interesting results: Image

What I also tried:

  • sudo apt install ca-certificates fonts-liberation libappindicator3-1 libasound2t64 libatk-bridge2.0-0 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgbm1 libgcc1 libglib2.0-0 libgtk-3-0 libnspr4 libnss3 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 lsb-release wget xdg-utils libgbm-dev libxshmfence-dev
  • chmod 0755 /var/www/html/formats/vendor/beganovich/snappdf/versions/1409252-Linux_x64/chrome-linux/chrome
  • chmod 0755 /var/www/html/formats/vendor/beganovich/snappdf/versions/1409252-Linux_x64/chrome-linux/chrome_crashpad_handler
  • php artisan optimize:clear

OlyaK95 avatar Jan 21 '25 23:01 OlyaK95