Translation plugin export problem [SOLVED]

Hi,
As with previous version, with OJS 3.0 I have problem exporting translations with tar function defined in config.inc.php when I try to export I get error on page http://migracija.ff.uns.ac.rs/index.php/gff/$$$call$$$/plugins/generic/translator/controllers/grid/locale-grid/export?locale=en_US:

cli.tar binary not properly configured.

Just to mention, I have downloaded Translation plugin from git OJS 3.0 Stable repo.

Hi @knjigor,

Just double-checking – are you working with config.ins.php or config.inc.php?

What specifically have you set up in your configuration file?

Regards,
Alec Smecher
Public Knowledge Project Team

Ah sorry, that was a typo it is config.inc.php. I didn’t set up nothing, it was by default there in [cli] section:

; tar (used in backup plugin, translation packaging)
tar = /bin/tar

And when I check in server which tar I get:

/bin/tar

Hi @knjigor,

The code that generates the error you’re seeing is…

 // Construct the tar command
$tarBinary = Config::getVar('cli', 'tar');
if (empty($tarBinary) || !file_exists($tarBinary)) {
    fatalError('cli.tar binary not properly configured.');
}

I suppose the call to file_exists is returning false – can you test it by creating a test PHP script such as…

<?php echo file_exists('/bin/tar')?'Exists':'Doesn\'t Exist'; ?>

Try invoking that via your web server and see what happens.

Regards,
Alec Smecher
Public Knowledge Project Team

I get Doesn't Exist

Hi @knjigor,

OK, that tells you that PHP isn’t able to access /bin/tar. There are a lot of potential reasons this could be the case – e.g. PHP scripts run on your server in a chroot environment, or something similar. Unfortunately it’s out of OJS’s hands; you’ll need to get that test script to be able to access a tar binary before OJS can do anything with it.

If your server is running in a chroot environment (or open_basedir or similar), you might need to copy the tar binary somewhere closer to where OJS is installed. Unfortunately there are so many server variations involved that I can’t give you specific instructions here.

Regards,
Alec Smecher
Public Knowledge Project Team

Thank you for suggestions Alec, I have moved tar from /bin/ to /private directory and set proper permissions on file, changed config.inc.php and now it is working. I know that this isn’t best solution but for now it will do.
Thank you once again.