How to Enable or Disable PHP's allow_url_fopen using CloudLinux Selector in Plesk? (Video)

Enabling or disabling PHP's allow_url_fopen directive through CloudLinux Selector in Plesk is not directly managed by checking a box like other extensions. Instead, allow_url_fopen is a PHP configuration option that you can modify through the PHP Settings page.

Here’s how you can manage this setting:

Step 1: Log in to Plesk

  • Open your Plesk control panel at https://your-domain.com:8443 (replace your-domain.com with your actual domain or server IP address).
  • Enter your username and password to log in.

Step 2: Access PHP Settings

  • From the Plesk dashboard, navigate to the "Domains" section.
  • Find the domain for which you want to enable or disable allow_url_fopen and click on it.
  • In the "Web Hosting" section, click on "PHP Settings".

Step 3: Open CloudLinux PHP Selector

  • On the PHP Settings page, you’ll see the "PHP Selector" or "Select PHP Version" section.
  • Click on "Select PHP Version" (or similar option) to choose the PHP version for your domain.

Step 4: Modify allow_url_fopen Setting

  1. After selecting the desired PHP version, you will be taken to a list of available PHP extensions and settings for that version.

  2. Scroll down to the "Additional Directives" or "Custom PHP Settings" section. This is where you can modify PHP configuration options such as allow_url_fopen.

  3. In the "Additional Directives" box, you can add custom PHP directives.

    • To enable allow_url_fopen, add the following line:

                   allow_url_fopen = On

  •         To disable allow_url_fopen, add the following line:

                   allow_url_fopen = Off

Step 5: Apply the Changes

  • After modifying the allow_url_fopen directive, scroll down and click "OK" or "Apply" to save the changes.

Step 6: Verify the Changes

  • To ensure that the change has been applied, you can create a phpinfo.php file in the root directory of your domain.
  • Create a file named phpinfo.php and add this code:

          <?php

           phpinfo();

           ?>

  • Visit http://your-domain.com/phpinfo.php in your browser.
  • Look for the allow_url_fopen directive in the output. It should show either On or Off based on the setting you applied.

Step 7: Remove the phpinfo.php File (Optional)

  • Once you’ve confirmed the setting has been applied correctly, it's a good idea to delete the phpinfo.php file for security reasons.

Troubleshooting

  • If you cannot see the "Additional Directives" box, it could be due to the Plesk version or CloudLinux settings. Ensure that you have access to modify PHP directives. If not, you may need to contact your hosting provider for assistance.
  • If the allow_url_fopen directive doesn’t change after following these steps, ensure that no higher-level configuration (like server-wide settings in php.ini) is overriding the directive.

By following these steps, you can enable or disable the allow_url_fopen directive for your PHP configuration using CloudLinux Selector in Plesk. This allows you to control whether PHP scripts on your domain can open remote URLs via file functions (such as file_get_contents() or fopen()).

 
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to Change the PHP Version via CloudLinux Selector in Plesk? (Video)

Changing the PHP version via CloudLinux Selector in Plesk is a straightforward process. Here’s...

How to Enable ionCube Loader using CloudLinux Selector in Plesk? (Video)

Enabling ionCube Loader on your server via CloudLinux Selector in Plesk is a simple process....

How to Enable the GD extension of PHP using CloudLinux Selector in Plesk? (Video)

Enabling the GD extension for PHP using CloudLinux Selector in Plesk is a straightforward...

How to Enable the Mailparse Extension of PHP Using CloudLinux Selector in Plesk? (Video)

To enable the Mailparse extension for PHP using CloudLinux Selector in Plesk. Follow these...

How to Enable or Disable PHP Extensions Using the CloudLinux Selector in Plesk? (Video)

Enabling or disabling PHP extensions via the CloudLinux Selector in Plesk is an easy and...