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
- Log in to your cPanel dashboard.
- Navigate to MultiPHP INI Editor under the Software section.
- Select your domain.
- Locate the
disable_functions
directive. - Add
exec
to the list of disabled functions: - Save your changes, and the function will be disabled.
Disabling exec()
in DirectAdmin
- Log in to DirectAdmin.
- Go to the PHP Settings section.
- Find the
disable_functions
field and addexec
. - Save the configuration.
Disabling exec()
in Plesk
- Log in to Plesk.
- Navigate to PHP Settings for your domain.
- Look for the
disable_functions
setting and addexec
. - 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
- Log in to cPanel and open MultiPHP INI Editor.
- Select your domain.
- In the
disable_functions
field, removeexec
from the list. - Save the changes.
Enabling exec()
in DirectAdmin
- Go to the PHP Settings in DirectAdmin.
- Remove
exec
from thedisable_functions
field. - Save your changes.
Enabling exec()
in Plesk
- Open PHP Settings in Plesk.
- Find the
disable_functions
field and removeexec
. - 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
- Check Panel Access: Make sure you have access to the PHP settings in your control panel.
- Modify the
php.ini
or.htaccess
: Use the methods described above to modify your PHP settings. - 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.
- 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!
Comments are closed