Bobcares

How to Fix “Forbidden: PHP engine is disabled” DirectAdmin Error

by | Jan 20, 2025

Learn how to fix the “Forbidden: PHP engine is disabled” DirectAdmin error. Our DirectAdmin Support team is here to help you with your questions and concerns.

How to Fix “Forbidden: PHP engine is disable” DirectAdmin Error

How to Fix “Forbidden: PHP engine is disable” DirectAdmin ErrorThe “Forbidden error,” also known as the HTTP 403 error, is a common issue that webmasters encounter. This error indicates that while the server understands the request, it refuses to authorize access. In a DirectAdmin web hosting environment, the error is often due to incorrect file and directory permissions, ownership settings, or misconfigurations in server settings.

Today, we will look at the causes of this error and the step-by-step solutions.

What is the Forbidden Error?

The HTTP 403 Forbidden error is an HTTP status code that signals access to a requested resource has been denied. Common causes of this error include:

  1. Permissions set too restrictively may block access.
  2. Incorrect ownership of files or directories.
  3. .htaccess File: Erroneous or restrictive rules in the `.htaccess` file.
  4. Absence of a default index file like `index.php` or `index.html.`
  5. Directives in server settings that restrict access.

Understanding the root cause is the key to resolving this error effectively.

Common Causes in DirectAdmin

  1. PHP Access is Disabled

    Error: “Forbidden: PHP engine is disabled.”

    Here, PHP support for the domain is disabled in DirectAdmin.

  2. File or Directory Permissions

    Permissions that prevent the server from executing PHP scripts or serving files.

    Typical permissions include:

    • Directories: `755`
    • Files: `644`
  3. Misconfigured `.htaccess` File

    Restrictive or erroneous rules in the `.htaccess` file that block access to resources.

Step-by-Step Solutions

1. Enable PHP Access in DirectAdmin

If PHP access is disabled, follow these steps:

  1. Log in to DirectAdmin.
  2. Navigate to Domain Setup and select Modify for the domain.
  3. Also, enable the checkbox for PHP Access.
  4. Then, click Save to apply changes.

2. Check and Configure PHP in Plesk

If using Plesk, ensure PHP is enabled and properly configured:

  1. Log in to your Plesk Panel.
  2. Go to the Websites & Domains tab.
  3. Then, expand Hide Advanced Operations and select Website Scripting and Security.
  4. Ensure the PHP Support option is enabled.
  5. Then, set the PHP handler to the Apache module in the Run As field.
  6. Click OK to save changes.

3. Fix File and Directory Permissions

Improper permissions can cause the server to block access to files or directories. Correct permissions as follows:

  1. Set directories to `755` and files to `644` using these commands:


    find /home/username/domains/domain.com/public_html -type d -exec chmod 755 {} \;
    find /home/username/domains/domain.com/public_html -type f -exec chmod 644 {} \;

  2. Also, ensure ownership of the files matches the web server user (e.g., `username:username`).

4. Inspect and Fix the .htaccess File

  1. Open the `.htaccess` file located in the website’s root directory.
  2. Look for and comment out restrictive rules that might block access.
  3. Ensure the file contains the correct directives to allow PHP execution.

5. Verify the PHP Version and Handler

  1. Log in to DirectAdmin as an admin.
  2. Check the PHP version and handler for the domain (e.g., FastCGI or Apache module).
  3. Then, ensure the selected PHP version is compatible with your website.

6. Check Server Logs

Server logs often contain detailed information about errors:

  1. View Apache error logs and DirectAdmin logs for more insights.
  2. Common log locations:
    • Apache logs: `/var/log/httpd/error_log` or `/var/log/apache2/error.log`
    • DirectAdmin logs: `/var/log/directadmin/error.log`

7. Review ModSecurity Rules

If ModSecurity is enabled, legitimate requests might be blocked. To resolve:

  1. Check the ModSecurity logs for blocked requests.
  2. Also, whitelist or modify rules as needed to allow access.

Prevention Tips

  • Always confirm that PHP is enabled for the domain.
  • Maintain proper permissions (`755` for directories, `644` for files).
  • Furthermore, avoid restrictive or erroneous rules.
  • Also, regularly update DirectAdmin and server modules to avoid compatibility issues.
  • Make changes in a staging environment to identify potential issues before deployment.

[Need assistance with a different issue? Our team is available 24/7.]

Conclusion

The “Forbidden: PHP engine is disabled” error in DirectAdmin can stem from several causes, including PHP settings, file permissions, or server configuration issues. We can diagnose and resolve the error by following the above solutions.

In brief, our Support Experts demonstrated how to fix the “Forbidden: PHP engine is disabled” DirectAdmin error.

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF