Technical documentation on managing PHP environments in cPanel using the CloudLinux PHP Selector. Learn how to switch PHP versions, enable extensions, and modify core php.ini directives.

Changing PHP Versions and Modifying INI Variables (CloudLinux PHP Selector)

Hovixa utilizes CloudLinux to provide isolated tenant environments (CageFS) and granular control over your PHP stack. To modify your PHP configuration, you must use the CloudLinux Select PHP Version tool. Do not manually edit .htaccess or php.ini files to declare limits; the CloudLinux selector overrides them, and manual file modifications will often result in conflicts or 500 Internal Server Errors.

1. Changing the PHP Version

The PHP Selector allows you to switch between supported PHP versions instantly. Ensure your application architecture (e.g., WordPress core, plugins, custom frameworks) is compatible with the target version before upgrading.

Configuration Steps:

  1. Log in to cpanel.hovixa.com.
  2. Navigate to the Software section and click Select PHP Version.
  3. Locate the Current PHP version dropdown at the top of the interface.
  4. Select the target PHP version (e.g., 8.2 or 8.3).
  5. Click Set as current. The page will refresh, and the new version is immediately active.

Architecture Note: If the version selector is locked or if your domain does not reflect the changes, ensure your domain is set to "Inherit" the system PHP version in the cPanel MultiPHP Manager. Hardcoding a version in the native MultiPHP Manager breaks CloudLinux PHP Selector functionality.

2. Enabling and Disabling PHP Extensions

Unlike standard cPanel environments where administrators dictate extensions globally via EasyApache, CloudLinux allows per-account module management.

  1. While on the Select PHP Version page, ensure the Extensions tab is active.
  2. Check the box next to required modules (e.g., imagick, redis, opcache, pdo_mysql) to enable them.
  3. Uncheck modules you do not use to reduce memory overhead.
  4. Changes are saved automatically. A success notification will render in the upper right corner.

3. Modifying PHP INI Directives

Resource limits (memory, execution time, upload sizes) are managed entirely through the web interface, directly modifying your CageFS virtual environment.

Configuration Steps:

  1. Click the Options tab at the top of the Select PHP Version interface.
  2. Locate the specific directive you need to modify:
    • memory_limit: Maximum memory allocated per script execution.
    • max_execution_time: Maximum time (in seconds) a script is allowed to run before termination.
    • upload_max_filesize: Maximum size for a single uploaded file.
    • post_max_size: Maximum size of POST data permitted (must be equal to or greater than upload_max_filesize).
    • display_errors: Enable strictly for debugging development environments; keep Off in production.
  3. Click the current value next to the directive. A dropdown menu or input field will appear.
  4. Select or type the new value. The system auto-saves immediately upon clicking outside the input field.
War diese Antwort hilfreich? 0 Benutzer fanden dies hilfreich (0 Stimmen)