PHPConfigurationcPanel4 min read

Configure PHP version

Change PHP version, enable extensions and adjust php.ini settings from cPanel.


PHP Selector in cPanel

Baires Host allows you to choose the PHP version for each domain. This is useful when you have applications that require specific versions.

Change PHP version

  1. Log in to cPanel
  2. Go to SoftwareMultiPHP Manager or Select PHP Version
  3. Select your domain
  4. Choose the desired version (8.1, 8.2 or 8.3)
  5. Click Apply

Available versions

VersionStatusRecommended for
PHP 8.1ActiveLaravel 9/10, WordPress 6.x
PHP 8.2ActiveLaravel 10/11, WordPress 6.4+
PHP 8.3ActiveNew projects, best performance

Enable/disable extensions

  1. In Select PHP Version, click on your active version
  2. You will see the list of available extensions
  3. Check or uncheck the ones you need:

Common extensions:

  • mysqli — MySQL connection (required by WordPress)
  • curl — External HTTP requests
  • gd / imagick — Image processing
  • mbstring — Multibyte support (UTF-8)
  • zip — File compression
  • opcache — Bytecode cache (improves performance)
  • intl — Internationalization

Configure php.ini

From Select PHP VersionOptions or PHP Options:

ini
; Maximum memory per script
memory_limit = 256M

; Maximum upload size
upload_max_filesize = 64M
post_max_size = 64M

; Maximum execution time
max_execution_time = 300

; Show errors (development only)
display_errors = Off
log_errors = On

; Timezone
date.timezone = America/Argentina/Buenos_Aires

Per-directory configuration (.user.ini)

If you need specific configuration for a subdirectory:

bash
# Create file in the desired directory
echo 'memory_limit = 512M' > /home/user/public_html/app/.user.ini
echo 'max_execution_time = 600' >> /home/user/public_html/app/.user.ini

Verify active configuration

Create a temporary info.php file:

php
<?php phpinfo(); ?>

Access it from your browser and verify the version and configuration. Delete this file afterwards for security.

Troubleshooting

  • Error 500 after changing version: Verify that required extensions are enabled
  • Deprecated functions: Check the error_log to identify incompatible code
  • Memory limit: Increase memory_limit gradually

Recommendations

  • Always use the latest version compatible with your application
  • Enable opcache to improve performance by up to 70%
  • Disable display_errors in production
  • Check PHP logs in ~/logs/ or from cPanel → MetricsErrors

Was this guide helpful?