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
- Open your terminal.
- Run one of the following commands:
which tar
or
whereis tar
- These commands will return the full path to tar, usually
/bin/tar
or/usr/bin/tar
.
Edit the config.inc.php File
- Open the
config.inc.php
file in your OJS installation directory. - 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
- Log in to the DirectAdmin admin panel as the server administrator.
Modify PHP Settings
- Navigate to “Server Manager” and then “PHP Configuration” or “PHP Settings”.
- 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)
- Open the PHP configuration file (
php.ini
). - Look for the
disable_functions
line and check ifexec
is listed. - If it is, remove
exec
from the list.disable_functions =
Restart the Server
- 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