PHP (Hypertext Preprocessor) is the server-side programming language that powers the majority of websites on the internet, including WordPress, Joomla, Drupal, Magento, and countless custom applications. Choosing the right PHP version and configuring it correctly is essential for website performance, security, and compatibility. This guide explains how to manage PHP settings on your SakuraHost hosting account.
Why PHP Version Matters
Each PHP version introduces performance improvements, new features, and security fixes, while eventually deprecating older functions. Running an outdated PHP version exposes your site to security vulnerabilities and results in slower performance. According to official PHP supported versions, each release receives active support for 2 years and security fixes for 1 additional year.
PHP Version Performance Comparison
| Version | Status | Speed vs 7.0 | WordPress Compatible |
|---|---|---|---|
| PHP 7.4 | End of Life | ~1.5x | Yes |
| PHP 8.0 | End of Life | ~2x | Yes |
| PHP 8.1 | Security Only | ~2.2x | Yes |
| PHP 8.2 | Active Support | ~2.5x | Yes |
| PHP 8.3 | Active Support | ~3x | Yes |
Checking Your Current PHP Version
To see which PHP version your site is currently running, you can create a simple PHP info file:
public_html and create a new file named phpinfo.php.
https://yourdomain.co.tz/phpinfo.php in your browser. The page will display detailed PHP configuration information, including the version number.
phpinfo.php file immediately after checking your PHP version. This file exposes sensitive server configuration details that could be exploited by attackers.
Changing the PHP Version
Using MultiPHP Manager
You can set different PHP versions for each domain and subdomain on your account. This is useful if you run multiple websites with different compatibility requirements.
Configuring PHP Settings with MultiPHP INI Editor
Some applications require specific PHP settings to be adjusted. The MultiPHP INI Editor in cPanel allows you to modify these settings without SSH access.
Basic Mode
The Basic Mode provides toggle switches and input fields for the most commonly modified settings:
- upload_max_filesize: Maximum size for file uploads (default: 2M, recommended: 64M or higher for WordPress media uploads).
- post_max_size: Maximum size of POST data. Should be equal to or greater than
upload_max_filesize. - max_execution_time: Maximum time (in seconds) a script can run before being terminated (default: 30, recommended: 300 for heavy operations).
- max_input_vars: Maximum number of input variables per request (default: 1000, increase to 5000 for complex WordPress sites with many plugins).
- memory_limit: Maximum amount of memory a script can consume (default: 128M, recommended: 256M).
Editor Mode
The Editor Mode provides a raw text editor where you can add custom PHP directives. Select your domain from the dropdown, and add directives in the php.ini syntax:
Using .user.ini for Per-Directory Configuration
For more granular control, you can create a .user.ini file in any directory. Settings in this file apply to that directory and all subdirectories. This is particularly useful for addon domains or subdirectories running different applications.
Troubleshooting PHP Issues
White Screen of Death (WSOD)
A blank white page usually indicates a fatal PHP error. Enable error display temporarily by adding this to your .user.ini or the top of your PHP script:
Remember to disable error display on production sites after debugging. Check cPanel's Metrics > Errors for the error log, which provides detailed information about PHP errors without exposing them to visitors.
Compatibility Issues After Upgrading
If your website breaks after upgrading PHP, check for deprecated functions. Common issues include the mysql_* functions (removed in PHP 7.0+), which should be replaced with mysqli_* or PDO. The PHP migration guides document all breaking changes between versions.
If you need help selecting the right PHP version or resolving compatibility issues, contact SakuraHost support at billing.sakurahost.co.tz.