How to Change PHP Version, Modules & Settings in cPanel Print

  • php version, php modules, php settings, cpanel, php configuration, php extensions, select php version, php options
  • 0

You can change your PHP version, enable or disable PHP modules, and adjust PHP settings directly from cPanel using the Select PHP Version tool. This powerful feature gives you complete control over your hosting environment without needing technical support, allowing you to optimize performance and compatibility for your applications in minutes.

How to Change Your PHP Version and Modules

OBHost provides full flexibility to customize PHP modules and libraries on a per-account basis. Here's how to modify your PHP configuration:

  1. Log into your cPanel account and navigate to the Software section
  2. Click on the Select PHP Version icon
  3. Choose your desired PHP version from the dropdown menu (for example, PHP 7.4, 8.0, or 8.1)
  4. Click Set as current to apply the version change
  5. A list of available PHP modules and extensions will appear below
  6. Use the checkboxes to enable or disable specific modules you need for your applications
  7. Click Save to confirm your changes

Your selected PHP modules will activate within a few moments. If you're running WordPress, Joomla, or other CMS platforms, ensure you select a PHP version that meets their minimum requirements for optimal performance and security.

How to Modify PHP Settings and Options

Beyond version and module selection, you can fine-tune individual PHP settings to match your application requirements:

  1. Access cPanel and open the Select PHP Version tool from the Software panel
  2. Click the Switch to PHP Options button at the top
  3. Browse the list of PHP configuration options (such as memory_limit, upload_max_filesize, max_execution_time, and post_max_size)
  4. Click on any option value to modify it. You'll either see an input field for custom values or a dropdown menu with preset options
  5. To enable a function currently disabled, locate the disable_functions setting and remove the function name from the list. Keep exactly one comma between remaining functions with no extra spaces
  6. Click Save to apply your configuration changes

Changes take effect immediately, though you may need to refresh your website or clear any caching to see the results.

Common PHP Settings to Adjust

Here are the most frequently modified PHP settings and what they control:

  • memory_limit: Controls how much memory a single PHP script can use. Increase this if you see memory exhausted errors (common values: 128M, 256M, 512M)
  • upload_max_filesize: Sets the maximum size for file uploads. Increase this for media-heavy websites or when uploading large files
  • post_max_size: Determines the maximum size of POST data. Should be equal to or larger than upload_max_filesize
  • max_execution_time: Limits how long a PHP script can run before timing out. Useful for import/export operations or complex processing tasks
  • max_input_vars: Controls the maximum number of variables your server can process. Increase this if you have large forms or complex page builders

Why Choose the Right PHP Version

Using the optimal PHP version is critical for both security and performance. Newer PHP versions offer significant speed improvements, better memory management, and enhanced security features. However, some legacy applications may require older versions for compatibility.

Always test your website after changing PHP versions, especially if upgrading from PHP 5.x to 7.x or 8.x. Most modern content management systems like WordPress perform best on PHP 8.0 or higher, while older custom applications might need PHP 7.4 for stability.

Troubleshooting PHP Configuration Issues

If your website displays errors after changing PHP settings, here are quick solutions:

  • Check error logs in cPanel under Metrics > Errors to identify the specific issue
  • Revert to your previous PHP version if the site stops working completely
  • Ensure required PHP modules are enabled for your application (like mysqli for database connections or gd for image processing)
  • Verify that custom PHP values don't exceed server limits set by your hosting plan
  • Clear browser cache and any caching plugins to see changes take effect

Frequently Asked Questions

Which PHP version should I use for WordPress?

For optimal performance and security, use PHP 8.0 or higher for WordPress. The latest WordPress versions fully support PHP 8.1 and 8.2, which deliver significantly faster page load times and improved security. Always check your theme and plugin compatibility before upgrading to ensure everything works smoothly.

How do I fix the memory limit exceeded error?

Navigate to Select PHP Version in cPanel, click Switch to PHP Options, then increase the memory_limit setting to 256M or 512M depending on your needs. This error commonly occurs with page builders, large product catalogs, or memory-intensive plugins. Save the changes and reload your website.

Can I use different PHP versions for different websites on the same account?

Yes, if you have multiple domains or subdomains, you can set different PHP versions and configurations for each one. Use the domain selector in the Select PHP Version tool to choose which site you're configuring, then apply your desired settings. This flexibility lets you run both modern and legacy applications on the same hosting account.

What happens if I disable a critical PHP module?

Disabling essential PHP modules can cause your website to malfunction or display errors. Common critical modules include mysqli (for database connections), curl (for external API requests), and gd (for image processing). If your site breaks after disabling a module, simply return to the Select PHP Version tool and re-enable it by checking the box and clicking Save.

The OBHost support team is available 24/7 to help with any PHP configuration questions or issues. Visit our contact page or email support@obhost.org for expert assistance with optimizing your hosting environment.


Was this answer helpful?

« Back