OJS: Translator plugin - export function problem

Hi, I have problem with export function of Translator plugin, I get message:

The export function of this plugin has been deactivated because the configured tar binary cannot be found on this system. Please make sure that you have the tar program installed and then configure the path to the tar binary in config.inc.php's [cli] section!

I was following this topic http://pkp.sfu.ca/support/forum/viewtopic.php?f=8&t=7031 but there is no solution.

In config.inc.php under [cli] tar is set to
tar = /bin/tar

which tar returns /bin/tar

tar --version returns
tar (GNU tar) 1.26 Copyright (C) 2011 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. `` Written by John Gilmore and Jay Fenlason.

Executing script
<?php
`ini_set('DISPLAY_ERRORS', E_ALL);`
echo "Here is the version of the tar tool:<br/><br/><pre>\n";
system('/bin/tar --version');
echo "<pre><br/><br/>\nThat is all.\n";
``
?>

returns

Here is the version of the tar tool: tar (GNU tar) 1.26 Copyright (C) 2011 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later . This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. `` Written by John Gilmore and Jay Fenlason.
``
That is all.`

safe_mod is off
ojs is 2.4.6

Server is ubuntu server 12.04 LTS (updated to latest version)

Thanks for the detailed description, @knjigor.

Can you confirm two things?

  1. Does the tar line appear correctly in the cli section if you navigate to Site Administrator > System Information and scroll down toward the bottom?
  2. Did you execute the test PHP script over the web (as opposed to executing it on the command line)?

Hi @knjigor,

Strange, if it works with your test php script it should with OJS. Let’s skip the tar check and see what happens, try replacing line 51 from plugins/generic/translator/TranslatorHandler.inc.php file by this:

$templateMgr->assign('tarAvailable', true);

After that, execute the export function and see if that works.

Let us know the result, if it fails try pasting the php log error.

Cheers,
Bruno

@ctgraham

  1. Line appear correctly /bin/tar.
  2. Executing script at web returns same text as above.

@beghelli

When replaced line i get error:
The tar binary must be configured in config.inc.php's cli section to use the export function of this plugin!

Very odd. It seems like file_exists($tarBinary) is returning false on your system.

There is another place that we check the tar binary at TranslatorAction.inc.php line 25.

To try @beghelli’s suggestion, also edit this line to:

		if (empty($tarBinary)) {

Can you confirm your php’s open_basedir setting, if any?

Thank you guys, the combination of changes in the files solved the problem.

Regarding open_basedir settings:

open_basedir: /var/www/clients/client3/web37/web:/var/www/clients/client3/web37/private:/var/www/clients/client3/web37/tmp:/var/www/ep2.ff.uns.ac.rs/web:/srv/www/ep2.ff.uns.ac.rs/web:/usr/share/php5:/usr/share/php:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin/var/www/clients/client3/web37/web:/var/www/clients/client3/web37/private:/var/www/clients/client3/web37/tmp:/var/www/ep2.ff.uns.ac.rs/web:/srv/www/ep2.ff.uns.ac.rs/web:/usr/share/php5:/usr/share/php:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin

I strongly suspect the root of the problem is the open_basedir setting in combination with the file_exists() function.