You are here:  » Unzip Failing


Unzip Failing

Submitted by chrisst1 on Mon, 2013-04-29 16:16 in

Hi David

We've just upgraded servers which now have PHP version 5.3 (the old server had 5.2). The automation tool has always worked fine but since the upgrade it fails. First it was transfer failing which we fixed with new firewall rules, but now it can't unzip the files. I've been in constant back and forth all day with the server company who insist all is in order and locations are as before.

My config settings are:
$config_automationHandler = "php";

$config_automationUnzipPrograms = array();
$config_automationUnzipPrograms["unzip"] = "/usr/bin/unzip";
$config_automationUnzipPrograms["gzip"] = "/bin/gzip";

$config_CRONPrograms = array();
$config_CRONPrograms["php"] = "/usr/local/bin/php";
$config_CRONPrograms["wget"] = "/usr/bin/wget";

Automation Handlers
php Available - Current Setting
curl Available

Automation Unzip Programs
unzip Available
gzip Available

Any ideas David?

Chris

Submitted by support on Mon, 2013-04-29 16:34

Hi Chris,

An upgrade shouldn't affect operation unless the configuration has also changed - for example you are now running in PHP's "safe mode" when it was not previously.

One thing to try would be to turn on all error reporting and then try running a job again, which may reveal the problem. To do this, add the following lines to the end of your config.advanced.php, just before the closing PHP tag:

  error_reporting(E_ALL);
  ini_set('display_errors','on');

If you're not sure from any PHP error / warning that is displayed where the problem lies let me know what (if anything) is additionally displayed and I'll check it out further with you...

Cheers,
David.

Cheers,
David.
--
PriceTapestry.com

Submitted by Birgir on Fri, 2013-05-31 12:22

Hi David,

I'm having the same problem with the automation tool. I'm trying to download a datafile from Linkshare and the ftp command works, but the error message is ERROR - UNZIP FAILED.

I have the same config settings in the config.advanced.php:

$config_automationHandler = "php";

$config_automationUnzipPrograms = array();
$config_automationUnzipPrograms["unzip"] = "/usr/bin/unzip";
$config_automationUnzipPrograms["gzip"] = "/bin/gzip";

$config_CRONPrograms = array();
$config_CRONPrograms["php"] = "/usr/local/bin/php";
$config_CRONPrograms["wget"] = "/usr/bin/wget";

and the automation handlers are:

Automation Handlers
php Available
curl Available

Automation Unzip Programs
unzip Available
gzip Available

I checked the php.ini and the safe_mode = Off

I also added the error reporting tag to the end of config.advanced.php, but that did not display an error report?

Any idea what might be wrong here?

Thanks,
Birgir

Submitted by support on Fri, 2013-05-31 13:03

Hi Birgir,

I'll email you in just a moment a version of includes/automation.php that uses PHP's internal gzip functions that might do the trick, if it works, then we can investigate why the external handlers aren't working separately...

Cheers,
David.
--
PriceTapestry.com

Submitted by Birgir on Fri, 2013-05-31 13:38

Hi David,

As always, you are spot on. This version works perfectly.

Cheers,
Birgir

Submitted by chrisst1 on Fri, 2013-05-31 15:52

Hi David

Just to update on my original post, I ended up using this mod http://www.pricetapestry.com/node/5029 which has fixed the issue and made the automation usable. I think the problem may be a Plesk 11 problem, when running the following everything appears to be installed with open_basedir locations added.

{link saved}

But checking unzip gives error in following:

{link saved}

whereas support.php give the following availables but the error log results show errors:

Automation Handlers
php Available
curl Available

Automation Unzip Programs
unzip Available
gzip Available

CRON
Option 1 Not Available

[Fri May 31 16:22:06 2013] [error] [client 85.233.190.121] PHP Warning: file_exists(): open_basedir restriction in effect. File(/usr/bin/php) is not within the allowed path(s): (/var/www/vhosts/#####/httpdocs:/tmp:/usr/bin/unzip:/bin/gzip) in /var/www/vhosts/#####/httpdocs/product-search/pt/admincp/support.php on line 79, referer: http://#####/product-search/0000/admincp/
[Fri May 31 16:22:06 2013] [error] [client 85.233.190.121] PHP Warning: file_exists(): open_basedir restriction in effect. File(/usr/bin/wget) is not within the allowed path(s): (/var/www/vhosts/######/httpdocs:/tmp:/usr/bin/unzip:/bin/gzip) in /var/www/vhosts/######/httpdocs/product-search/pt/admincp/support.php on line 88, referer: http://#####/product-search/0000/admincp/

Chris

Submitted by support on Sat, 2013-06-01 08:20

Thanks for the update, Chris.

Yes - since it is designed (I think) to facilitate reseller hosting Plesk defaults include an open_basedir restriction which is what is causing the "not within the allowed path(s)". Based on a quick search it looks like it is configurable from "Websites & Domains" > PHP Settings, where you might find an "open_basedir" option. Removing any existing value will remove the setting and should then enable exec of the required commands.

Cheers,
David.
--
PriceTapestry.com