• Resolved maksymj

    (@maksymj)


    I have installed the cwebp from this tutorial – https://www.tecmint.com/convert-images-to-webp-format-in-linux/

    I added the cwebp to bash, so i can just type ‘cwebp’ to access it.

    Still the plugin does not work, cwebp test shows:
    Found no cwebp binaries in any common system locations. Tried executing supplied binary for Linux, but that failed too (same error)

    I created a php file to test.

    shell_exec(‘cwebp 2>&1’) and exec(‘cwebp 2>&1’)

    both outputs “sh: cwebp: command not found”

    Two below commands work

    shell_exec(‘/usr/libwebp-0.6.1-linux-x86-32/bin/cwebp 2>&1’)
    exec(‘/usr/libwebp-0.6.1-linux-x86-32/bin/cwebp 2>&1’)

    Also if I add

    putenv(‘PATH=/usr/libwebp-0.6.1-linux-x86-32/bin’);

    before

    shell_exec(‘cwebp 2>&1’) and exec(‘cwebp 2>&1’)

    it works just fine.

    So I tried adding
    putenv(‘PATH=/usr/libwebp-0.6.1-linux-x86-32/bin’);
    to the wp-config.php and running shell_exec(‘cwebp 2>&1’) in admin hook, which works, so I don’t understand why the plugin still don’t work?

    See image below

    Web Express

    Could anyone help please?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter maksymj

    (@maksymj)

    Found a solution!

    I had to move the ‘cwebp’ script to ‘/usr/bin/’ where all the binaries are.

    Close please ??

    Plugin Author rosell.dk

    (@roselldk)

    Yes, it currently has to be put into a standard location. In Cwebp.php, they are currently:

    $cwebpDefaultPaths = [
    ‘/usr/bin/cwebp’,
    ‘/usr/local/bin/cwebp’,
    ‘/usr/gnu/bin/cwebp’,
    ‘/usr/syno/bin/cwebp’
    ];

    In the upcoming 2.0 release of WebPConvert, ‘cwebp’ has been added to the default paths (and your first attempt would have worked for you)

    • This reply was modified 5 years, 10 months ago by rosell.dk.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘cwebp installed but not working?’ is closed to new replies.