Enabling or disabling PHP extensions via the CloudLinux Selector in Plesk is an easy and flexible process that allows you to manage the extensions for individual domains. This is particularly useful when you need to customize the PHP environment for different websites hosted on your server.
Here’s how to do it:
Step 1: Log in to Plesk
- Open your Plesk control panel by navigating to
https://your-domain.com:8443
(replaceyour-domain.com
with your actual domain or server IP address). - Enter your Plesk admin username and password to log in.
Step 2: Access PHP Settings
- In the Plesk dashboard, navigate to the "Domains" section.
- Find the domain for which you want to manage PHP extensions and click on it.
- 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 the "Select PHP Version" dropdown. This will take you to a page that shows all PHP versions installed on your server.
Step 4: Choose the PHP Version
- After selecting the desired PHP version for your domain (e.g., PHP 7.4, PHP 8.0, PHP 8.1, etc.), you will be directed to a page where you can manage the PHP extensions for that specific version.
Step 5: Enable or Disable PHP Extensions
- In this page, you will see a list of PHP extensions available for the selected PHP version.
- To enable an extension, simply check the box next to the extension name (e.g.,
GD
,Mailparse
,ionCube
, etc.). - To disable an extension, uncheck the box next to the extension name.
Some common extensions you may find include:
- GD (for image processing)
- ionCube (for encrypted PHP files)
- cURL (for making HTTP requests)
- mbstring (for multi-byte string handling)
- Mailparse (for email parsing)
Step 6: Apply the Changes
- After enabling or disabling the required extensions, scroll down to the bottom of the page and click the "Apply" or "OK" button to save the changes.
Step 7: Verify the Changes
- To verify that the PHP extensions have been enabled or disabled correctly, you can create a
phpinfo.php
file in the root directory of your domain. - Create a file named
phpinfo.php
and add the following code to it:
phpinfo();
- Visit
http://your-domain.com/phpinfo.php
in your browser. - Look for the relevant extensions in the PHP info page. If the extension is enabled, it will be listed. If it is disabled, it will not appear.
Step 8: Remove the phpinfo.php File (Optional)
- After confirming the changes, it's a good idea to delete the
phpinfo.php
file from your server for security reasons.
Troubleshooting
- If you don’t see a particular PHP extension in the list, it may not be installed on your server. In this case, you may need to contact your hosting provider or system administrator to install the missing extension.
- Ensure that CloudLinux is correctly configured on your server. The PHP Selector functionality is part of CloudLinux, and if it's not installed or configured properly, the extensions may not be available for selection.
By following these steps, you can easily enable or disable PHP extensions for your domain using the CloudLinux Selector in Plesk. This gives you fine-grained control over the PHP environment for each website you manage.