Different web applications require different PHP configurations. cPanel allows you to change PHP versions and settings for your hosting account.
Changing PHP Version
- Log into cPanel
- Go to Software section
- Click MultiPHP Manager or Select PHP Version
- Check the domain(s) you want to change
- Select PHP version from dropdown
- Click Apply
Available PHP Versions
Ahosting typically offers:
- PHP 7.4 (legacy support)
- PHP 8.0
- PHP 8.1
- PHP 8.2
- PHP 8.3 (latest)
Recommendation: Use the latest PHP version your application supports for best performance and security.
Modifying PHP Settings (php.ini)
- Go to Software > MultiPHP INI Editor
- Select your domain
- Modify settings as needed
- Click Apply
Common PHP Settings
| Setting | Default | Purpose |
|---|---|---|
| upload_max_filesize | 2M | Maximum file upload size |
| post_max_size | 8M | Maximum POST data size |
| max_execution_time | 30 | Script timeout in seconds |
| memory_limit | 128M | Maximum memory per script |
| max_input_vars | 1000 | Maximum form variables |
| max_input_time | 60 | Input parsing timeout |
Enabling/Disabling PHP Extensions
- Go to Software > Select PHP Version
- Click your current PHP version
- Check/uncheck extensions
- Click Save
Common PHP Extensions
- mysqli / pdo_mysql: MySQL database connectivity
- curl: HTTP requests
- gd / imagick: Image processing
- zip: ZIP file handling
- mbstring: Multibyte string handling
- intl: Internationalization
- opcache: PHP code caching (performance)
WordPress Recommended Settings
upload_max_filesize = 64M post_max_size = 64M max_execution_time = 300 memory_limit = 256M max_input_vars = 3000
Creating Custom php.ini
For per-directory PHP settings, create a php.ini file in that folder:
- Go to File Manager
- Navigate to the directory
- Create a file named
php.ini - Add your settings:
upload_max_filesize = 128M post_max_size = 128M
Checking Current PHP Settings
Create a phpinfo file to view all settings:
- Create a file
phpinfo.phpin public_html - Add:
<?php phpinfo(); ?> - Visit yourdomain.com/phpinfo.php
- Delete this file after checking (security risk)
Troubleshooting
- Changes not working: Clear browser cache and site cache
- 500 error after change: Revert PHP version or settings
- Extension not available: Contact support to enable