• Resolved Simone

    (@simobn88)


    Hi,
    I used your plugin in almost 5 website and all works great!

    Today I had an issue with a new website, I’m unable to convert images.

    I asked to host support and they said “ask to developer first” πŸ™

    This is what happens:

    Result: Failure
    Message: None of the cwebp files located can be executed. All failed with return code 126 (permission denied)
    Conversion log:
    Converter set to: cwebp

    *WebP Convert 2.1.4* ignited.
    – PHP version: 7.2.22
    – Server software: Apache/2.4.41 (cPanel) OpenSSL/1.0.2t mod_bwlimited/1.4

    Cwebp converter ignited

    Options:
    ————
    The following options have been set explicitly. Note: it is the resulting options after merging down the “jpeg” and “png” options and any converter-prefixed options.
    – source: /home/user/public_html/wp-content/plugins/webp-express/test/test-pattern-tv.jpg
    – destination: /home/user/public_html/wp-content/webp-express/webp-images/doc-root/wp-content/plugins/webp-express/test/test-pattern-tv.jpg.webp
    – default-quality: 70
    – encoding: “auto”
    – low-memory: true
    – log-call-arguments: true
    – max-quality: 80
    – metadata: “none”
    – method: 6
    – near-lossless: 60
    – quality: “auto”
    – use-nice: true
    – command-line-options: “”
    – try-common-system-paths: true
    – try-supplied-binary-for-os: true

    The following options have not been explicitly set, so using the following defaults:
    – alpha-quality: 85
    – auto-filter: false
    – preset: “none”
    – size-in-percentage: null (not set)
    – skip: false
    – rel-path-to-precompiled-binaries: *****
    ————

    Encoding is set to auto – converting to both lossless and lossy and selecting the smallest file

    Converting to lossy
    Locating cwebp binaries
    No cwebp binaries where located in common system locations
    Checking if we have a supplied binary for OS: Linux… We do.
    We in fact have 3
    A total of 3 cwebp binaries where found
    Detecting versions of the cwebp binaries found (and verifying that they can be executed in the process)
    Executing: /home/user/public_html/wp-content/plugins/webp-express/vendor/rosell-dk/webp-convert/src/Convert/Converters/Binaries/cwebp-linux-1.0.2-shared -version
    Exec failed (return code: 126)
    PS: Return code 126 means “Permission denied”. The user that the command was run with does not have permission to execute that binary.
    Executing: /home/user/public_html/wp-content/plugins/webp-express/vendor/rosell-dk/webp-convert/src/Convert/Converters/Binaries/cwebp-linux-1.0.2-static -version
    Exec failed (return code: 126)
    PS: Return code 126 means “Permission denied”. The user that the command was run with does not have permission to execute that binary.
    Executing: /home/user/public_html/wp-content/plugins/webp-express/vendor/rosell-dk/webp-convert/src/Convert/Converters/Binaries/cwebp-linux-0.6.1 -version
    Exec failed (return code: 126)
    PS: Return code 126 means “Permission denied”. The user that the command was run with does not have permission to execute that binary.

    **Error: ** **None of the cwebp files located can be executed. All failed with return code 126 (permission denied)**

    What can I ask to host support to check?

    Thank you

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author rosell.dk

    (@roselldk)

    Well, yes, it requires cooperation with the host to fix this.

    As the log shows, cwebp is not installed on the server. You could ask them to install cwebp.

    WebP Express is bundled with precompiled cwebp’s. But the host does not allow executing random executables – which is very normal. You could try to persuade them to make an exception with the bundled cwebps (paths are in the log). I however doubt that they will be willing. So go with the first option: Ask them to install cwebp and set permissions which allows cwebp to be executed by the PHP.

    I take it that none of the other conversion methods are working out of the box either? (Vips, Imagick, etc). Vips is just as good is cwebp. Imagick and ImageMagick are also very good. You could ask them to install Vips extension or Imagick with webp support.

    Here is a place to start:
    https://github.com/rosell-dk/webp-convert/wiki/Meeting-the-requirements-of-the-converters

    Plugin Author rosell.dk

    (@roselldk)

    You could also enable the web service on one of the sites where you have cwebp working and use the “Remote WebP Express” method to connect to it.

    Plugin Author rosell.dk

    (@roselldk)

    A letter to the host:

    Dear [Host],

    I’m eager to use the webp format and tried the webp-convert library for converting images with PHP (https://github.com/rosell-dk/webp-convert/). The library can convert images using multiple methods (imagick extension, gd extension, vips extension, executing cwebp, exectuting imagemagick etc). To be able to convert I need just a single one of these to be properly installed on the server. However, the library tells me that none of them are available.

    Can you please provide support for webp conversion with PHP by supporting one of these methods?

    Note that it is not enough to have Imagick installed. It must be installed with webp support. The same goes for Gd. Regarding cwebp, the library tries to execute the “cwebp” command. cwebp needs to be installed and www-data needs to have permission to execute it.

    The developer provided some installation guides on the wiki here: https://github.com/rosell-dk/webp-convert/wiki/Meeting-the-requirements-of-the-converters

    PS: The developer tells me that Vips is light on resources, easy to install and does not require special setup to get webp working.

    Thread Starter Simone

    (@simobn88)

    I Rosell.dk
    thank for your reply. I passed almost 4 hours in chat with tech support but they didnt solved the problem. (they installed Imagick but didnt compiled it :P)

    In conclusion they asked me for email, they will assist me from there………

    I understand that you want to prevent any attack but this is more than what I was expecting (and I dont like to delay fixes for too long with my customers) so I configured remote compression using another website and I made the trick!

    Your plugin is fantastic!

    Plugin Author rosell.dk

    (@roselldk)

    Yeah, tech support can be a heavy dance partner. Four hours… I can think of better ways to spent four hours. Really, tech support should be able to just fix it, without you on the line. Glad that the Remote WebP Express feature could end that nightmare.

    Plugin Author rosell.dk

    (@roselldk)

    Your suffering has not been in vain. I realized I could prevent such experiences in the future by creating a PHP test script for the webhosts. And I have just done so. It displays which conversion methods that works and provides links to installation instructions for those that does not work. I have put it here: https://github.com/rosell-dk/webp-convert/wiki/A-PHP-script-for-the-webhost

    Thread Starter Simone

    (@simobn88)

    Fabolous!!!

    Yesterday I opened the website and all images url was corrupted, so I disabled cache plugin and webP plugin waiting to change host…. they told me the server doesnt support webP and they have no solutions…. -_-“

    @roselldk NEw to the plugin. I am on Centos 7 with Plesk Onyx server I have root control. Running multisite and nginx. I have the suggested nginx directives set.

    I did yum install libwebp-tools.
    Your test script above shows
    “Executing cweb Works! Version: 0.3.0”

    But your script inside wordpress shows deactivated.
    A test shows several of these
    “*Warning: file_exists(): open_basedir restriction in effect. File(/usr/bin/cwebp) is not within the allowed path(s):”

    Any suggestions? Thanks

    AFter posting I searched more for just open_basedir and found that plesk has the php admin to change the paths for open_basedir.

    In plesk I was able to add {WEBSPACEROOT}{/}{:}{TMP}{/}{:}/usr/bin to open_basedir and it now shows cweb active.

    My concern is that anything run on this site can now access /usr/bin

    Should this be done differently for security reasons?

    thank you

    Plugin Author rosell.dk

    (@roselldk)

    Hi @cng11,

    Adding /usr/bin to open_basedir is probably not a good idea.
    I was about to say that you do not need to, because the plugin tries executing the cwebp command directly. However, while testing this out, I discovered a bug and the cwebp command is actually not tried.

    The cwebp command works with open_basedir restriction (at least on my test setup).

    To try if that helps, you can edit the following file:
    plugins/webp-express/vendor/rosell-dk/webp-convert/src/Convert/Converters/Cwebp.php.

    Line 419-421 says:

    
    if (@file_exists($binary)) {
        $binaries[] = $binary;
    }
    

    Change that to:

    
    if (true) {
        $binaries[] = $binary;
    }
    

    The line filtered out the cwebp command, as this is not a file.

    I shall have that fixed in the next release.

    Plugin Author rosell.dk

    (@roselldk)

    I have fixed the cwebp issues (#221 and #223). It is part of the new 0.17.0 release of WebP Express

    Yes thank you for the quick reply and fix. I can confirm that it is working for me without changing open_basedir to include cwebp path.

Viewing 12 replies - 1 through 12 (of 12 total)

The topic ‘Test failed (no permission)’ is closed to new replies.