When managing a journal on platforms like OJS (Open Journal Systems), you may encounter various technical requirements that relate to server configurations. One commonly asked question is about the PHP function exec(). In this post, we’ll explore what exec() does, why it’s important for OJS, and how to enable or disable it depending on your hosting setup.

What is exec()?

The exec() function in PHP is used to execute external commands directly from a script. This can be extremely useful for web applications that need to perform system-level tasks such as generating PDFs, processing large datasets, or running specific background processes.

For example, in OJS, exec() is often necessary when the system needs to interface with external tools like pdftotext (used for generating text from PDFs) or other indexing and conversion tools. Without the exec() function enabled, certain functionalities in OJS may not work as expected, which can lead to incomplete workflows or broken features.

Why is exec() Needed for OJS?

Many OJS installations rely on exec() to run tasks that involve file management, text extraction from documents, or automated processes. Disabling exec() may lead to problems with:

  • Full-text search generation from uploaded PDF files.
  • Running scheduled tasks like automatic indexing.
  • Processing article data for search engines and other services.

Thus, for many advanced features to work smoothly in OJS, having exec() enabled is important.


How to Disable exec()

In some hosting environments, you may want to disable exec() for security reasons. The method to disable it varies depending on the control panel software your hosting uses. Below are the steps for disabling exec() on common platforms:

Disabling exec() in cPanel

  1. Log in to your cPanel dashboard.
  2. Navigate to MultiPHP INI Editor under the Software section.
  3. Select your domain.
  4. Locate the disable_functions directive.
  5. Add exec to the list of disabled functions:
    ini
    disable_functions = exec,passthru,shell_exec,system
  6. Save your changes, and the function will be disabled.

Disabling exec() in DirectAdmin

  1. Log in to DirectAdmin.
  2. Go to the PHP Settings section.
  3. Find the disable_functions field and add exec.
  4. Save the configuration.

Disabling exec() in Plesk

  1. Log in to Plesk.
  2. Navigate to PHP Settings for your domain.
  3. Look for the disable_functions setting and add exec.
  4. Apply the changes.

How to Enable exec()

If you need to enable exec() to ensure OJS functions properly, you’ll follow a similar process but remove exec() from the disabled list.

Enabling exec() in cPanel

  1. Log in to cPanel and open MultiPHP INI Editor.
  2. Select your domain.
  3. In the disable_functions field, remove exec from the list.
  4. Save the changes.

Enabling exec() in DirectAdmin

  1. Go to the PHP Settings in DirectAdmin.
  2. Remove exec from the disable_functions field.
  3. Save your changes.

Enabling exec() in Plesk

  1. Open PHP Settings in Plesk.
  2. Find the disable_functions field and remove exec.
  3. Apply the changes.

The Solution Varies Based on Your Panel

As seen, the exact process for enabling or disabling exec() depends on the control panel software used by your hosting provider. cPanel, DirectAdmin, and Plesk all offer different ways to configure PHP settings, and the location of these options can differ slightly.

If you’re using a different panel software, such as ISPConfig, or you don’t have direct access to these settings, it’s important to contact your hosting or server provider for help. They can either guide you through the process or apply the changes on your behalf.


General Troubleshooting Steps

  1. Check Panel Access: Make sure you have access to the PHP settings in your control panel.
  2. Modify the php.ini or .htaccess: Use the methods described above to modify your PHP settings.
  3. Restart Apache: In some cases, changes will only take effect after restarting the web server. If you’re on shared hosting, your provider can assist with this.
  4. Contact Support: If you don’t have access to the necessary panel features, contact your hosting provider.

Need Further Assistance?

If you’re unable to make these changes or are facing issues, don’t hesitate to reach out to your hosting or server provider for assistance. Alternatively, you can contact us for specialized support with OJS installations and configurations, including enabling or disabling exec() and other PHP functions.

Feel free to contact us for more information!

Categories:

Comments are closed

0
    0
    Your Cart
    Your cart is emptyReturn to Shop