Your hosting account may support multiple PHP versions to run simultaneously. Using the PHP Selector (or MultiPHP Manager), you can choose which version each domain, subdomain, or public_html directory uses. This is useful when migrating sites to newer PHP versions or running applications that require specific versions.
What is PHP?
PHP is the programming language that powers most web applications. Newer versions are faster and more secure, but some older websites may require older PHP versions to function correctly.
Accessing PHP Selector
In cPanel
- Log in to your cPanel control panel.
- Navigate to Software → PHP Selector (or MultiPHP Manager).
The name and location may vary slightly depending on your hosting provider's cPanel setup.
Setting PHP version for a domain
Method 1: Using PHP Selector (per-directory)
If your hosting supports PHP Selector:
- In the PHP Selector interface, select the domain or public_html directory from the dropdown at the top.
- Choose your desired PHP version (e.g., 7.4, 8.0, 8.1, 8.3).
- Click Set as current or Apply.
The selected version is now active for that directory and its subdirectories (unless overridden).
Method 2: Using MultiPHP Manager (per-domain)
If your hosting uses MultiPHP Manager:
- In the MultiPHP Manager interface, you'll see a list of your domains.
- Check the box next to the domain(s) you want to modify.
- From the PHP Version dropdown, select your preferred version (e.g., 8.0, 8.1, 8.3).
- Click Apply.
The change applies to the entire domain immediately.
Checking your current PHP version
- In cPanel: Look at the top of the PHP Selector/MultiPHP Manager page—it shows your current version.
- On your website: Create a temporary test file called phpinfo.php in your public_html directory with the code:
```php
<?php phpinfo(); ?>
```
Visit http://yourdomain.com/phpinfo.php to see your current PHP version and extensions. Delete this file once you've checked, for security.
Before changing PHP versions
- Test first: If you're migrating to a newer PHP version, test thoroughly on a staging site or subdomain before switching your main domain.
- Check extension compatibility: Some PHP extensions may not be available in newer versions. See the full list of enabled extensions in PHP Selector.
- Backup your site: Always keep a recent backup before making major changes.
- Review error logs: After switching, check your site's error log for warnings or failures.
Common PHP versions
| Version | Status | Use Case |
|---------|--------|----------|
| 7.4 | Older | Legacy sites; limited security updates |
| 8.0 | Stable | Modern sites; good balance of features and compatibility |
| 8.1 | Stable | Latest stable; best performance and security |
| 8.3 | Latest | Newest features; requires newer applications |
Newer versions are generally recommended for security and performance, unless your site specifically requires an older version.
Tips
- Some hosting providers allow different PHP versions for subdomains and public_html—experiment safely on a non-critical subdomain first.
- If you see "module" or "extension" errors after changing versions, you may need to add missing extensions in the PHP Selector (the Extensions section).
- Contact your hosting provider if you're unsure which version your application requires.