To enable or disable PHP's display_errors
directive using CloudLinux Selector in Plesk, you can follow these steps. This directive controls whether PHP errors are displayed on the web page, which is useful for debugging but should be turned off in production environments to avoid exposing sensitive information.
Step 1: Log in to Plesk
- Open your Plesk control panel at
https://your-domain.com:8443
(replaceyour-domain.com
with your actual domain or IP address). - Enter your Plesk username and password to log in.
Step 2: Access PHP Settings
- In the Plesk dashboard, go to the "Domains" section.
- Select the domain for which you want to enable or disable
display_errors
. - Under the "Web Hosting" section, click on "PHP Settings".
Step 3: Open CloudLinux PHP Selector
- On the PHP Settings page, look for the "PHP Selector" or "Select PHP Version" section.
- Click on "Select PHP Version" to choose the PHP version for your domain.
Step 4: Modify display_errors
Setting
-
After selecting the desired PHP version, you’ll see a list of available PHP extensions and settings for that version.
-
Scroll down to the "Additional Directives" or "Custom PHP Settings" section. This is where you can modify custom PHP configuration options, including
display_errors
. -
In the "Additional Directives" box, you can add custom PHP directives:
- To enable
display_errors
, add the following line:
- To enable
display_errors = On
display_errors = Off
Step 5: Apply the Changes
- After modifying the
display_errors
directive, scroll down and click "OK" or "Apply" to save the changes.
Step 6: Verify the Changes
- To verify that
display_errors
is set correctly, you can create aphpinfo.php
file in the root directory of your domain. - Create a file named
phpinfo.php
and add this code to it:
phpinfo();
- Visit
http://your-domain.com/phpinfo.php
in your browser. -