Many users of Open Journal Systems (OJS) encounter the error “The tar command is not available” when installing plugins or themes. This error occurs because OJS cannot access the tar command. In this blog post, we will detail the possible causes of this error and provide various solutions.

Potential Causes of the Problem

  • Incorrect Tar Path: OJS cannot correctly identify the path to the tar command.
  • PHP Settings: Certain PHP functions, particularly the exec() function, might be disabled.
  • Open Basedir Restriction: A security setting in PHP that restricts access to certain directories.

Solutions

1. Correcting the Tar Path

The most common cause of this error is that OJS cannot find the correct path to the tar command. Here are the steps to fix this:

Find the Tar Path via Terminal

  1. Open your terminal.
  2. Run one of the following commands:
    which tar

    or

    whereis tar
  3. These commands will return the full path to tar, usually /bin/tar or /usr/bin/tar.

Edit the config.inc.php File

  1. Open the config.inc.php file in your OJS installation directory.
  2. Add or modify the following line with the correct path:
    ; tar (used in backup plugin, translation packaging)
    tar = /bin/tar  // or the correct path you found

2. Disabling Open Basedir Restriction

If the tar path is correctly set but the error persists, the problem might be due to the PHP open_basedir restriction. Follow these steps to disable it:

Log in to DirectAdmin Panel

  1. Log in to the DirectAdmin admin panel as the server administrator.

Modify PHP Settings

  1. Navigate to “Server Manager” and then “PHP Configuration” or “PHP Settings”.
  2. Select the relevant domain and check the “Disable Open Basedir” option.

3. Enabling the exec() Function

If the above steps do not resolve the issue, the exec() function might be disabled in PHP. To enable it:

Edit the PHP Configuration File (php.ini)

  1. Open the PHP configuration file (php.ini).
  2. Look for the disable_functions line and check if exec is listed.
  3. If it is, remove exec from the list.
    disable_functions = 

Restart the Server

  1. Restart your web server for the changes to take effect.

Summary

The “The tar command is not available” error usually occurs due to incorrect tar path configuration or PHP settings. To resolve this issue, you can:

  • Correctly configure the tar path.
  • Disable the Open Basedir restriction.
  • Enable the PHP exec() function.

These steps should help resolve the issue. If you continue to experience problems, it may be beneficial to contact your server administrator. Hopefully, this guide will assist you in resolving any issues you encounter while using OJS.

Contact Us

If you need any assistance with OJS, whether it’s for academic journal setup, updates, or other services, please feel free to contact us. We are here to help with all your OJS needs.

 

Comments are closed

0
    0
    Your Cart
    Your cart is emptyReturn to Shop