The tar command is not available. Please correctly configure it in your "config.inc.php"

Hello, I need some help
I can’t install plugins from gallery
When I press OK nothing happens, When I reload the page this message appears
The tar command is not available. Please correctly configure it in your “config.inc.php”.
Localhost
Windows 10 64x
XAMPP x64-7.2.21-2-VC15
OJS 3.1.2.1
PHP version: 7.2.21

  • Apache/2.4.39 (Win64) OpenSSL/1.1.1c PHP/7.2.21
  • Database client version: libmysql - mysqlnd 5.0.12-dev - 20150407 - $Id:

Hi @Younes_SAAID

In order to be able to install plugins from the plugin gallery directly, you need to install the “tar” command on your server. It’s a utility that unpacks archives, sort of like unzip. I’m not really sure what that will look like on a Windows server though.

If you want, you can also install plugins by downloading the archive directly to your PC, unpacking it there, and then FTPing it up to your server, in the correct plugins/ subdirectory. Then you can install it via the plugin grid.

Cheers,
Jason

1 Like

Php errour
Stack trace:
#0 C:\xampp\htdocs\ojs\lib\pkp\controllers\grid\plugins\PluginGalleryGridHandler.inc.php(270): PluginHelper->upgradePlugin(‘importexport’, ‘quickSubmit’, NULL, ‘The tar command…’)
#1 C:\xampp\htdocs\ojs\lib\pkp\controllers\grid\plugins\PluginGalleryGridHandler.inc.php(236): PluginGalleryGridHandler->installPlugin(Array, Object(Request), true)
#2 C:\xampp\htdocs\ojs\lib\pkp\classes\core\PKPRouter.inc.php(390): PluginGalleryGridHandler->upgradePlugin(Array, Object(Request))
#3 C:\xampp\htdocs\ojs\lib\pkp\classes\core\PKPComponentRouter.inc.php(257): PKPRouter->_authorizeInitializeAndCallRequest(Array, Object(Request), Array)
#4 C:\xampp\htdocs\ojs\lib\pkp\classes\core\Dispatcher.inc.php(134): PKPComponentRouter->route(Object(Request))
#5 C:\xampp\htdocs\ojs\lib\pkp\classes\core\PKPApplication.inc.php(252): Dispatcher->dispatch(Object(Request))
#6 C:\xampp\ht in C:\xampp\htdocs\ojs\lib\pkp\classes\plugins\PluginHelper.inc.php on line 206
[19-Aug-2019 14:06:38 Europe/Berlin] PHP Fatal error: Uncaught Error: Call to a member function getProductType() on string in C:\xampp\htdocs\ojs\lib\pkp\classes\plugins\PluginHelper.inc.php:206

Hi @Younes_SAAID

Did this error happen after you got the tar command correctly configured? how did you generate the error?

Cheers,

No. thats the issue. the error after clicking on OK to install .
I believe that the problem is on tar command
i dont know how to correct configuration of the tar command.
im new at this … tell me how i will try thanks
OJS 3.1.2.1
Localhost XAMPP Windows 10 64x

I see from your other post that you installed 7zip. While that may work on tar archives, it’s not the tar command that OJS needs. Try:

http://gnuwin32.sourceforge.net/packages/gtar.htm

and be sure to update your config.inc.php file with the full path to the command

Cheers,

@jnugent how to set up config.inc.php file with the path? I downloaded the tar for windows but how you set up it Can you explain me please

See also:

Hi @ctgraham,
well I’ve tried this a put the path between quotes and the system still throws at me the same error. Maybe any other sollution for windows you know of ? I’m pretty desperate because I have no clue as to why this is not working, even though I’ve installed the tar archiver and set the path to it inside the config.php file.
Best regards,

Matus

Are you seeing the same error in the web interface? Or the same error in the error log? Or both? If you haven’t yet looked at your PHP error log, please check there for any relevant messages.

I don’t have experience deploying OJS under a Windows server, but generally the prerequisites will be:

  • Your config.inc.php must:
    • Point to the path of the tar.exe. (it sounds like you are confident this is the case)
  • Your PHP interpreter must:
    • Be able to read the file (consider your local file permissions, and your webserver user access, and PHP’s directives like open_basedir)
    • Be able to execute the file (consider PHP directives like disable_functions)

Hi @ctgraham, first of all thanks a lot for reaching back to me!.
Well I checked with my sys admin and the whole folder should have the read/write permissions. Everything works as expected except functions like sending emails and installing plugins (also I tried to change the backslash into commonslah and now i get this notiffication error attached below).
error2
Also I noticed the fulltext search returns no results and if I try to use advanced filters I can not set the day, the select element returns only option for number 0.
Fact is that I just uploaded the back issues and their respected galleys, because the journal I’m trying to migrate didn’t publish separate articles but rather whole issues altogether. I thought that the system’s search should return searched issues regardless of whether they have articles assigned to them, considering the option that you can in fact publish issue with its galley.

server info:
server

Can you confirm what version of OJS you are using? The date selector in the advanced search may be related to a bug prior to 3.1.2-1 (https://github.com/pkp/pkp-lib/issues/4713). There also may be configuration issues for your search indexing. Full text searching is accomplished by external commands defined in config.inc.php:
https://github.com/pkp/ojs/blob/689030272394896b1317ecbcbad15c186ea3b831/config.TEMPLATE.inc.php#L380-L398
If you need assistance configuring this, please open a new forum thread dedicated to that as a question.

For the file upload problem, you may find more details on the cause of the message you see within the PHP error log. You may need to request this from your sysadmin. Provide him or her the specific date and time when you see the error on the screen to find the relevant PHP error messages.

For future reference, I’d like to add a simple solution to get tar working on Windows 10, as I ran into this problem myself with running OJS 3.2.0.2 on XAMPP 7.4.5-0-VC15.

Windows 10 does include tar since build 17063 and therefore you just have to add the escaped path to your config.inc.php. Replace tar = /bin/tar with:
tar = C:\\Windows\\System32\\tar.exe

This worked for me and now I’m able to install plugins from the Plugin Gallery.

4 Likes

This solutions works for me Too! thanks nicolos!

Thank you very much.