The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Failure to find ImageMagic and/or NetPbm using Gallery

Discussion in 'General Discussion' started by SupermanInNY, Apr 10, 2004.

  1. SupermanInNY

    SupermanInNY Well-Known Member

    Joined:
    Jul 19, 2003
    Messages:
    255
    Likes Received:
    0
    Trophy Points:
    16
    Hi All,

    I have a user who wants to run the Gallery (see link).

    http://gallery.menalto.com/modules.php?op=modload&name=phpWiki&file=index&pagename=Help


    In the installation process the first thing the Gallery checks is for the existance of ImageMagick and/or NetPBM.

    Both are showing as installed on my system,. but Gallery can't seem to find them.

    My questions are as follow:

    1. How to tell if ImageMagick is indeed installed on my system and I'm not imagining that it is?
    I ran convert and I get the following msg:


    bess.shev.com:/home/alon => convert
    Version: ImageMagick 5.5.1 10/20/02 Q16 http://www.imagemagick.org
    Copyright: Copyright (C) 2002 ImageMagick Studio LLC

    Usage: convert [options ...] file [ [options ...] file ...] [options ...] file

    Where options include:..... (and all the switches etc.. etc..).

    bess.shev.com:/home/alon => mogrify
    Version: ImageMagick 5.5.1 10/20/02 Q16 http://www.imagemagick.org
    Copyright: Copyright (C) 2002 ImageMagick Studio LLC

    Usage: mogrify [options ...] file [ [options ...] file ...]

    Where options include: (and again all the switches related show up).

    This is ran from user root and user jailshell (just incase it needed the shell - but this user is actually not having a shell access) - either way it didn't work.


    This is from the install page of the Gallery:

    Warning!
    "I can't find ImageMagick. If it's installed and not in the path of the webserver user that's OK—you can specify the path to ImageMagick by hand on the following page. If it's not installed, you must install it. Gallery prefers ImageMagick version 5.4.8 and up. You can compile and install the entire ImageMagick package from the ImageMagick website.
    Note: The site also has binaries available for assorted operating systems. If you can't get it working, try leaving the ImageMagick path blank and using NetPBM instead."


    Also:

    Warning!
    "I can't find NetPBM. If it's installed and not in the path of the webserver user that's OK—you can specify the path to NetPBM by hand on the following page. If it's not installed, you have two choices: Gallery prefers NetPBM version 9.9 and up. You can install just the binaries Gallery needs from the Gallery Download Page. Or, you can compile and install the entire NetPBM package from the NetPBM website.
    Note: You can install the binaries from the Gallery site even if you don't have root access on your box! If you can't get it working, try leaving the NetPBM path blank and using ImageMagick instead."

    any suggestions on how to make things run?
    What am I missing?
    What path should I give them?
    Where do I set this path on permanent basis?
    Why is it not showing up to begin with?

    Thanks,

    -Alon.
     
  2. Planet_Master

    Planet_Master Well-Known Member

    Joined:
    Apr 18, 2002
    Messages:
    233
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    New Yorker
    Basically sounds like your paths are not defined. If the applications are installed then Gallery needs to know where they are.

    For NetPBM it is usually in /usr/local/netpbm/ but if you installed from rpm in WHM then it could be /usr/bin/netpbm/

    For ImageMagick it is most likely /usr/lib but executables can be in /usr/bin as well as a host of different places. try forcing a re-install from WHM for both abd make sure you install the netpbm-progs as well.

    I suspect if you define the correct paths in Gallery you can execute the application. Try slocate to find all your paths.
     
  3. SupermanInNY

    SupermanInNY Well-Known Member

    Joined:
    Jul 19, 2003
    Messages:
    255
    Likes Received:
    0
    Trophy Points:
    16
    The was resolved.

    How?

    Well. .it appears that PHP Safe_mode is doing something.

    I had safe_mode enabled all that time.
    Gallery does force the user to have safe_mode disable, but I've decided not to 'listen' to that advise.

    I've disabled safe_mode for that site and like "Magic",.. all the paths have been repaired.

    I need a reminder of what are the harms of running safe_mode disabled.

    Thanks for everyone's help with that.

    -Alon.
     
  4. Planet_Master

    Planet_Master Well-Known Member

    Joined:
    Apr 18, 2002
    Messages:
    233
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    New Yorker
    Ah, that was my other thought...lol

    Good that you got it working.

    Basically you shouldnt even be running in safe_mode, not accepted by most apps.
     
  5. SupermanInNY

    SupermanInNY Well-Known Member

    Joined:
    Jul 19, 2003
    Messages:
    255
    Likes Received:
    0
    Trophy Points:
    16
    Back to the draw board!

    Safe mode is a must!
    My friend just gave me a simple demonstration of the great time a user can have running with safe_mode disabled.

    go ahead.. try it yourself:

    Create a file called test.php

    (don't forget to chown to the user's id)

    in it put the following line:


    <?php

    system ("cat /etc/passwd");

    ?>

    Now,. go access this file in safe_mode disabled.
    Enjoy the show.

    You can really do evil stuff with that one!

    What is the solution?
    Well... first: enable safe_mode.
    Second,.. go to the php.ini (you are probably going to use the one that is in:

    /usr/local/Zend/etc

    assuming you installed the Zend Optimizer.

    Now,.. in it you have lines that look like:


    ; Safe Mode
    safe_mode = On
    safe_mode_exec_dir =


    I modified those lines to look like:


    ; Safe Mode
    safe_mode = On
    safe_mode_exec_dir = /usr/safe_mode


    Next, I created the directory

    /usr/safe_mode

    In this directory, I placed Symbolic Links to the list of binaries that I believe are safe to use.
    For instance.. I will not put cat in it! Hell no!
    but, I can put mogrify!
    The syntax just in case you were looking for it is:

    ln -s /bin/cat /usr/safe_mode/cat

    Obviously you don't want to use cat as one of those symbolic links, but that is the example link.

    For the none technical guys.. this will create a "file" called cat in the /usr/safe_mode directory.

    It looks like a file,. but it is not. it will even show with a little arrow pointing to the source file when you issue a ls -la command.

    Since you treat it like a file.. you can also remove it like a file and you do this by issusing the rm command.

    rm cat

    This will prompt you for: Really remove Simbolic Link?
    The answer would be Yes.

    Now it is time to pile up the "safe" list of binaries that are ok to use and would not pose a serious threat to the system.

    I believe there should be a list of "safe to use" binaries somewehre out there for that purpose, with security in mind.

    Hope this helps.

    -Alon.
     
Loading...

Share This Page