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.

unzip from PHP with mod Ruid2

Discussion in 'General Discussion' started by boing, May 9, 2015.

  1. boing

    boing Member

    Joined:
    May 4, 2015
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    United States
    cPanel Access Level:
    Root Administrator
    Hello,

    I'm trying to allow a PHP web application (a gallery application) access to /usr/bin/unzip so users can upload .zip files of photos which then get unzipped and added to their gallery.

    I'm using easy Apache with PHP 5.4, mod Ruid2 0.9.8, Mod Security 2.8.0, and php open_basedir Protection is enabled. So far, users are getting:
    setting: /usr/bin/unzip
    result: "The path you entered isn't a valid path to an unzip binary."

    And of course the path is correct:
    Code:
    ll /usr/bin/unzip
    -rwxr-xr-x 2 root root 160344 Mar 18 09:52 /usr/bin/unzip
    
    I have a feeling it has to do with the fact that PHP doesn't have access to /usr/bin/unzip. But I'm not quite sure how to resolve this. (copy the binary elsewhere? sym link, etc.?)

    On phpinfo, I see under Apache, Environment, _SERVER["PATH"], _ENV["PATH"] /bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin
    /bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin
    /bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin

    Any ideas?

    Thanks!
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello,

    Have you considered simply enabling the "zip" module under the "Exhaustive Options List" for PHP via EasyApache? You may want to check to see if Gallery supports that module.

    Thank you.
     
  3. boing

    boing Member

    Joined:
    May 4, 2015
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    United States
    cPanel Access Level:
    Root Administrator
    Hi,

    I had considered it, yes. But past experience has taught me that this gallery is literally looking for the executable for things like unzip and/or convert (ImageMagick). Other things I know it does support via php modules, GD as an example.

    That said, I gave it a go. And although the setup for the module still errors out, the actual functionality of uploading a .zip file works! So - we'll call this done, and thank you very much.
    :)

    Thanks!
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    I am happy to see the issue is now resolved. Thank you for updating us with the outcome.

    Thank you.
     
Loading...

Share This Page