Enabling the GD extension for PHP using CloudLinux Selector in Plesk is a straightforward process. The GD library is commonly used for image manipulation in PHP, such as generating thumbnails, creating charts, or working with other image-related functionality.
Here's how you can enable 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 server's actual domain or IP address). - Enter your username and password to log in.
Step 2: Access PHP Settings
- Once you’re logged into Plesk, go to the "Domains" section from the main menu.
- Find the domain for which you want to enable the GD extension and click on it.
- Under the "Web Hosting" section, click on "PHP Settings".
Step 3: Access CloudLinux PHP Selector
- On the PHP Settings page, you should see a section called "PHP Selector" or "PHP Version".
- Click on the "Select PHP Version" dropdown (the exact name of this option may vary depending on the version of Plesk and CloudLinux).
- This will take you to a page where you can select the PHP version for your domain.
Step 4: Enable GD Extension
- After selecting the desired PHP version, you will see a list of available PHP extensions.
- Scroll through the list to find "gd" or "GD".
- Check the box next to "GD" to enable the extension.
- You may also see specific options for enabling different variants of the GD extension (e.g.,
gd2
,gd
, etc.). Ensure that the correct option is selected for your needs.
Step 5: Apply the Changes
- After checking the box next to GD, scroll down to the bottom of the page and click the "Apply" or "OK" button to save the changes.
Step 6: Verify the GD Extension is Enabled
- To ensure that the GD extension has been successfully enabled, 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. - On the page that loads, look for a section related to the GD library. It should display information about the GD version and supported image formats (e.g., JPEG, PNG, GIF).
Step 7: Remove the phpinfo.php File (Optional)
- Once you've verified that the GD extension is enabled, delete the
phpinfo.php
file from your server for security reasons.
Troubleshooting
- If the GD extension does not appear in the PHP extensions list, ensure that CloudLinux is installed on your server and the necessary extensions are available. You may need to contact your hosting provider to enable or install the GD extension on the server.
- If you don’t see GD listed in the PHP Selector for the selected version, try switching to another PHP version that might have the GD extension available.
By following these steps, you can easily enable the GD extension for PHP using CloudLinux Selector in Plesk.