unzip from PHP with mod Ruid2
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:
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!
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!
-
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. 0 -
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! 0 -
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.
I am happy to see the issue is now resolved. Thank you for updating us with the outcome. Thank you.0
Please sign in to leave a comment.
Comments
3 comments