Skip to main content

Add WebP support to GD (PHP Module)

Comments

8 comments

  • cPanelMichael
    Hello, Could you let us know if the system uses EasyApache 3, or EasyApache 4? With EasyApache 3, you can use raw opts as documented at: Raw Opts - EasyApache - cPanel Documentation Information about an EasyApache 4 equivalent is discussed on the following thread: EA4 equivalent for php rawopts ? Thank you.
    0
  • BoxMan
    Thanks for useful link. I use EasyApache 3 and PHP 5. So I must create file:
    /var/cpanel/easy/apache/rawopts/all_php5
    with this content:
    --with-vpx-dir --path-to-vpx-dir=/usr/lib64/libvpx.so --my-option= --with-webp-dir --path-to-webp-dir=/usr/lib64/libwebp.so --my-option=
    And than rebuild, is it true?
    0
  • JacobPerkins
    Hi BoxMan, This *should* work, but attempt it and see how it works.
    0
  • BoxMan
    thanks, but no change. it's not work for me. I do as I said in last post.
    0
  • cPanelMichael
    --with-vpx-dir --path-to-vpx-dir=/usr/lib64/libvpx.so --my-option= --with-webp-dir --path-to-webp-dir=/usr/lib64/libwebp.so --my-option=

    Hello, Try using the following entries before running EasyApache again and let us know if it makes a difference:
    --with-vpx-dir=/usr --with-webp-dir=/usr
    Thank you.
    0
  • BoxMan
    hooray !! it's work, really thanks. Codes in box.. ;)
    0
  • SunHunter
    Hi, I'm getting exactly the same issue as the original poster but using EasyApache 4 / PHP 7.4. I've read the whole of this post, and would like to install GD using the 'with-webp-dir' option so that the imagewebp() function becomes available, but very stuck on how to do this with EasyApache4 (instructions above were for EA3). I've noticed a file called gd.ini inside /opt/cpanel/ea-php74/root/etc/php.d/ but not sure if it's just a case of appending the 'with-webp-dir' option to that file and then re-running EA? (a bit scared of doing this in case i bork the server) (EDIT: I read on another thread that in EA 3 you could create a 'rawopt' file called 'all_php_5' for PHP configuration options, but an 'all_php_7' equivalent doesn't seem to exist in EA 4 so not sure where'd you'd configure the installation of a specific extension?)
    0
  • SunHunter
    Now rolled my own imagewebp() function as I had a live site that needed the functionality (upgraded a site from an older version of PHP that already had the same function). For anyone else, I installed Google's cwebp library and I'm calling it from PHP (works well enough). [CODE=php]exec('cwebp -q ' . $quality . ' ' . $jpegFileName . ' -o ' . $webpFileName);
    (Don't really like relying too much on external libraries, but there doesn't seem much other option here)
    0

Please sign in to leave a comment.