This guide addresses a common issue where attempting to view the phpinfo() page in Plesk results in an error message: "Unable to retrieve information about the PHP configuration." If your PHP handler is set to "FPM application served by Apache" or another Apache-based handler, restrictive Apache rewrite rules may be causing this error. Here's how to resolve it.

Possible Cause

The error occurs due to restrictive Apache rewrite rules blocking access to the domain's phpinfo() page. Common restrictive rules might look like this:


<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteCond %{REQUEST_URI} "!(^|/).well-known/([^./]+./?)+$" [NC]
  RewriteCond %{SCRIPT_FILENAME} -d [OR]
  RewriteCond %{SCRIPT_FILENAME} -f
  RewriteRule "(^|/)." - [F]
</IfModule>
<IfModule mod_authz_core.c>
  <FilesMatch "(^#.*#|.(bak|conf|dist|fla|in[ci]|log|orig|psd|sh|sql|sw[op])|~)$">
    Require all denied
  </FilesMatch>
</IfModule>

Resolution

To fix this issue, you can disable these restrictive rewrite rules by either modifying your Apache settings in Plesk or adjusting the .htaccess file directly.

Option 1: Disable Rewrite Rules in Plesk Apache & nginx Settings

  1. Log in to your Plesk dashboard.
  2. Go to Domains > example_domain.com > Apache & nginx Settings.
  3. In the Additional Apache Directives section, locate the HTTP and HTTPS fields.
  4. Remove any restrictive rewrite rules from these fields.
  5. Click Apply and OK to save your changes.

Note: Removing these rules might impact other configurations. Ensure to back up your settings before making changes.

Option 2: Modify the .htaccess File via SSH

  1. Connect to your server via SSH. If you need help connecting, refer to the Plesk documentation.
  2. Navigate to the directory containing the .htaccess file for your domain. Typically, this is located in /var/www/vhosts/example_domain.com/httpdocs/.
  3. Open the .htaccess file in a text editor, such as vim:
    vim /var/www/vhosts/example_domain.com/httpdocs/.htaccess
  4. Remove the restrictive rules as shown in the example above.
  5. Save and close the file by pressing Esc, then typing :wq, and pressing Enter.

Testing the Resolution

After making these changes, return to Plesk and attempt to view the phpinfo() page again by navigating to Domains > example_domain.com > PHP Settings > View the phpinfo() page.

Disclaimer: Always test these changes in a staging environment before applying them to your live server. For the latest guidance, consult the official Plesk documentation.

Did this answer help? 0 People found this helpful (0 Votes)