"tar command not available" - correct path in config.inc.php - workaround? [OJS 3.3.0.19]

Dear OJS-Community,

in August, we have moved our OJS installation to a new web server. Today, I realized that I could no longer install plugins from the Plugin Gallery: “The tar command is not available. Please correctly configure it in your “config.inc.php”.”

We have specified the correct file path to the tar command in config.inc.php.

I found this discussion between @piotreba and @asmecher from May 2022 that some server configurations prevent the following test in lib/pkp/classes/plugins/PluginHelper.inc.php from succeeding. The file_exists condition failure seems to result from open_basedir restrictions:

// Test whether the tar binary is available for the export to work
		$tarBinary = Config::getVar('cli', 'tar');
		if (empty($tarBinary) || !file_exists($tarBinary)) {
			rmdir($pluginExtractDir);
			throw new Exception(__('manager.plugins.tarCommandNotFound'));
		}

If the if statement is commented out, I can install tar files in the plugin gallery (tested with OJS 3.3.0.19 and PHP 8.1 and 8.3).

However, other functions are also affected by this problem, not only the installation of plugins. For example, the DNB export plugin – it provides the export of article metadata and full texts for their transfer to the German National Library (DNB) – issues the following error message: “Plugin requirements not met: TAR command (s. cli part in the config.inc.php) is required for export and deposit.”

Since we are using the DNB export plugin, is there a workaround for this problem?

Kind regards,
Michael

I have just realised that it was embarrassingly the wrong file path after all. On both our old and new web server, the tar command is located in the /bin/tar folder. That’s why I didn’t update the path in config.inc.php after moving to the new server. However, the new server seems to require a more detailed file path. After changing the path to /var/www/vhosts/hosting123456.xxxxx.xxxxxx.net/bin/tar it works.

Please excuse this ultimately pointless thread.

This topic was automatically closed after 3 days. New replies are no longer allowed.