WordPress.org

Ready to get started?Download WordPress

Forums

EWWW Image Optimizer
[resolved] something goes wrong here... (20 posts)

  1. peterpijpelink
    Member
    Posted 2 years ago #

    hello I like your plugin and wants to use it! However, after install I tried it and gave me a warning. EWWW Image Optimizer requires jpegtran, optipng, and gifsicle. You are missing: jpegtran, optipng, gifsicle. Please install via the Installation Instructions and update paths (if necessary) on the Settings Page.

    When I try this optipng on the cmdline it works (as root). My locations I did specify but still the plugin keeps giving the same error.

    [root@ns1 /]# find -name optipng
    ./usr/local/bin/optipng
    ./var/www/vhosts/plcs.eu/httpdocs/optipng-0.7.1/src/optipng
    ./var/www/vhosts/plcs.eu/httpdocs/optipng-0.7.1/src/optipng/optipng
    [root@ns1 /]#

    So I added the /usr/local/bin/ one and also tried to other one. no luck, same for the other jpg and gif optimizer.

    [root@ns1 /]# find -name gifsicle
    ./usr/local/bin/gifsicle
    ./var/www/vhosts/plcs.eu/httpdocs/gifsicle-1.67/src/gifsicle
    [root@ns1 /]#

    no luck so far, what am I doing wrong here? I did install in the httpdocs folder of this vhost but also see the files when I run them from any other place fine.

    [root@ns1 /]# pwd
    /
    [root@ns1 /]# optipng -v
    OptiPNG version 0.7.1
    Copyright (C) 2001-2012 Cosmin Truta and the Contributing Authors.

    This program is open-source software. See LICENSE for more details.

    Portions of this software are based in part on the work of:
    Jean-loup Gailly and Mark Adler (zlib)
    Glenn Randers-Pehrson and the PNG Development Group (libpng)
    Miyasaka Masaru (BMP support)
    David Koblas (GIF support)

    Using libpng version 1.4.9 and zlib version 1.2.6-optipng
    [root@ns1 /]#

    [root@ns1 /]# gifsicle -v
    gifsicle: <stdin>: is a terminal
    [root@ns1 /]#

    any idea? help is welcome :)

    http://wordpress.org/extend/plugins/ewww-image-optimizer/

  2. nosilver4u
    Member
    Plugin Author

    Posted 2 years ago #

    what is the output of these commands:
    which optipng
    which /usr/local/bin/optipng

    It is possible that the 'which' command is not functioning properly, in which case, it is necessary to check the box on the settings page to disable the utility checks. It looks like you certainly have them installed correctly on the system, so it should not be necessary to enter any paths on the settings page.
    You can verify that things are working by running a couple images through the re-optimize on the Media Library page after you check that 'skip utility' box on the settings page.

  3. peterpijpelink
    Member
    Posted 2 years ago #

    Hello ! wow you are a good guy ;) quick very quick response.

    here is the output:

    [root@ns1 /]# which optipng
    /usr/local/bin/optipng

    [[root@ns1 /]# which /usr/local/bin/optipng
    /usr/local/bin/optipng

    Looks like it is the same one they use ??

  4. peterpijpelink
    Member
    Posted 2 years ago #

    Okay did as you asked, do paths in the settings and disable the check, did some images re-optimize and no savings it says. I tried all the modules on a ssh session (as user root) and they work fine, mostly --help or /? gives output for all 3.

  5. nosilver4u
    Member
    Plugin Author

    Posted 2 years ago #

    well, the next response may not be so speedy, gotta go pull some weeds...
    At any rate, perhaps the web-server user does not have permissions to see those files and that is causing the issues. You can use top generally to look and see what use is running the apache process. You should be looking for something like 'httpd' or 'apache2'.

    Then run this:
    ls -l /usr/local/bin/optipng

    That will tell us the permissions set on the optipng binary file.

    If it doesn't have x in all 3 'sections' that could be the issue. Binaries need to be executable by all. That can be fixed by running this command:
    chmod 755 /usr/local/bin/optipng

    Do that for all the binaries, and see what happens. You should be able to uncheck that 'skip utilities check' checkbox on the settings page at this point.

  6. peterpijpelink
    Member
    Posted 2 years ago #

    here is the output

    [root@ns1 /]# ls -l /usr/local/bin/optipng
    -rwxrwxrwx 1 root root 210056 Jul 7 17:13 /usr/local/bin/optipng

    hums what about the owner of the files? Can apache access them even it says root root ?

    [root@ns1 /]# ls -l /usr/local/bin/gifsicle
    -rwxr-xr-x 1 root root 419208 Jul 7 17:15 /usr/local/bin/gifsicle

    [root@ns1 /]# ls -l /usr/bin/jpegtran
    -rwxr-xr-x 1 root root 22280 Jan 6 2007 /usr/bin/jpegtran
    [root@ns1 /]#

    so optipng should work when I try pure a .png file?

  7. peterpijpelink
    Member
    Posted 2 years ago #

    Same thing, as soon as I enter the paths or without the paths and leave the box unchecked it does not work.

    media library says: Unsupported file type
    optipng is missing

    do you like to see what happens with a team viewer session on my machine?

  8. peterpijpelink
    Member
    Posted 2 years ago #

    [root@ns1 /]#
    [root@ns1 /]# chmod 755 /usr/bin/jpegtran
    [root@ns1 /]# chmod 755 /usr/local/bin/gifsicle
    [root@ns1 /]# chmod 755 /usr/local/bin/optipng
    [root@ns1 /]# ls -l /usr/bin/jpegtran
    -rwxr-xr-x 1 root root 22280 Jul 7 18:53 /usr/bin/jpegtran
    [root@ns1 /]# ls -l /usr/local/bin/optipng
    -rwxr-xr-x 1 root root 210056 Jul 7 17:13 /usr/local/bin/optipng
    [root@ns1 /]# ls -l /usr/local/bin/gifsicle
    -rwxr-xr-x 1 root root 419208 Jul 7 17:15 /usr/local/bin/gifsicle
    [root@ns1 /]#

    checked again, they are all chmod 755 now.

  9. peterpijpelink
    Member
    Posted 2 years ago #

    Just to make sure, did a find on all 3 modules

    [root@ns1 /]# find -name jpegtran
    ./usr/bin/jpegtran

    [root@ns1 /]# find -name optipng
    ./usr/local/bin/optipng
    ./var/www/vhosts/plcs.eu/httpdocs/optipng-0.7.1/src/optipng
    ./var/www/vhosts/plcs.eu/httpdocs/optipng-0.7.1/src/optipng/optipng

    [root@ns1 /]# find -name gifsicle
    ./usr/local/bin/gifsicle
    ./var/www/vhosts/plcs.eu/httpdocs/gifsicle-1.67/src/gifsicle
    [root@ns1 /]#

    do these also need to be chmod 755 ?

  10. peterpijpelink
    Member
    Posted 2 years ago #

    top - 19:05:42 up 64 days, 9:23, 1 user, load average: 0.32, 0.48, 0.52
    Tasks: 76 total, 2 running, 74 sleeping, 0 stopped, 0 zombie
    Cpu(s): 18.1%us, 1.3%sy, 0.0%ni, 80.6%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
    Mem: 8154972k total, 7074780k used, 1080192k free, 527444k buffers
    Swap: 4192944k total, 176k used, 4192768k free, 4089852k cached

    PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
    21644 apache 15 0 685m 87m 6792 R 17.3 1.1 0:09.28 httpd
    21714 apache 15 0 648m 58m 5452 S 16.0 0.7 0:06.34 httpd

    here is the output on the top process.

  11. nosilver4u
    Member
    Plugin Author

    Posted 2 years ago #

    The permissions looked fine originally, but they should for sure work now for everyone. Just by way of explanation, and using your output for jpegtran as an example:
    -rwxr-xr-x 1 root root 22280 Jul 7 18:53 /usr/bin/jpegtran
    The first - is the directory character, which should be a - unless you're looking at a folder. The next 3 are the permissions for the owner, the second group of 3 is permissions for the group, and the third group is for everyone else. r = read, w = write, x = execute

    so here's the next thing I would try:

    use the switch user command to change to the 'apache' user, which is the one running the webserver:
    su apache

    Then try running this like you did originally:
    optipng -v

    You can type 'exit' or press Ctrl-D to end the apache shell and go back to root.

  12. peterpijpelink
    Member
    Posted 2 years ago #

    I am not allowed to su to apache...

    [root@ns1 /]# su apache
    This account is currently not available.

    [root@ns1 /]# su - apache
    This account is currently not available.

    However if I su to another user (my co-worker for example)

    [root@ns1 /]# su remco
    [remco@ns1 /]$ optipng -v
    OptiPNG version 0.7.1
    Copyright (C) 2001-2012 Cosmin Truta and the Contributing Authors.

    This program is open-source software. See LICENSE for more details.

    Portions of this software are based in part on the work of:
    Jean-loup Gailly and Mark Adler (zlib)
    Glenn Randers-Pehrson and the PNG Development Group (libpng)
    Miyasaka Masaru (BMP support)
    David Koblas (GIF support)

    Using libpng version 1.4.9 and zlib version 1.2.6-optipng
    [remco@ns1 /]$

  13. nosilver4u
    Member
    Plugin Author

    Posted 2 years ago #

    I was afraid of that, that user account is likely not allowed to have shell access, which makes me wonder if that is why it can't execute the other commands. I would ask your webhost for more information about that. I'm not sure what else to do to troubleshoot this issue. If you find anything out, please post it back here for others to see.

  14. peterpijpelink
    Member
    Posted 2 years ago #

    I made a call at their support desk. Keep you updated. thanks so far for your excellent support!

  15. nosilver4u
    Member
    Plugin Author

    Posted 2 years ago #

    One last thing that might help would be to set this line in wp-config.php:
    define('WP_DEBUG', true);

    Make sure to turn it back off later.

  16. nosilver4u
    Member
    Plugin Author

    Posted 2 years ago #

    Another 'last thing'... Make sure PHP's safe mode is not turned on. I'm including a check in 1.0.8 for this, due out shortly.

  17. peterpijpelink
    Member
    Posted 2 years ago #

    Yes safe mode is on and must stay on. I asked our hoster and they look at the other option monday,

    " most probably the open_basedir restrictions that block you from using this. open_basedir restricts access of the php script to files only in the web directories."

    I keep you updated.

  18. nosilver4u
    Member
    Plugin Author

    Posted 2 years ago #

    then we're at an impasse, there's no way to get the plugin to work in safe mode. Safe mode forces exec() to run only binaries in a specific folder. Besides optipng, jpegtran, and gifsicle, we use 'mv', 'rm', and 'which'. There's just too much effort to try and get those to all work together in the safe mode exec folder. sorry

  19. peterpijpelink
    Member
    Posted 2 years ago #

    I will ask them, I did a checkup using W3 cache and it says safe mode is on.

    Server Modules & Resources:

    Plugin Version: 0.9.2.4
    PHP Version: 5.2.17 (PHP5 required for Minify, Rackspace CloudFiles, Microsoft Azure support)
    Web Server: Apache
    FTP functions: Installed (required for Self-hosted (FTP) CDN support)
    Multibyte String support: Installed (required for Rackspace Cloud Files support)
    cURL extension: Installed (required for Amazon S3, Amazon CloudFront, Rackspace CloudFiles support)
    zlib extension: Installed (required for compression support)
    Opcode cache: Installed (APC)
    Memcache extension: Installed
    HTML Tidy extension: Not installed (required for HTML Tidy minifier suppport)
    Mime type detection: Not installed (required for CDN support)
    Hash function: Installed (hash) (required for NetDNA purge support)
    Safe mode: On
    Open basedir: On: /var/www/vhosts/plcs.eu/httpdocs:/tmp
    zlib output compression: Off

    so maybe Open basedir will help, but yea as you said, I doubt we get this working with safe mode on, we do insist on using safe mode on as it is more secure.

  20. peterpijpelink
    Member
    Posted 1 year ago #

    it is solved.

    1. disaple PHP safe_mode for this domain in Plesk (CentOS)
    2. copy the 3 binaries in a safe directory, which is OUTSIDE of the web site (security recommendation by the plugin programmer!) - I chose /var/www/vhosts/domain.com/bin
    3. modify the php variable open_basedir in the vhost.conf file by adding the path to the directory chosen in 2.
    4. Add the correct path in WordPress
    5. restart Apache to take over the changes

    :) thankS!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.