If you're running a website on PHP (like WordPress, Laravel, or Joomla), having the right PHP version and extensions is crucial for performance and compatibility. At Sternhost, we make it easy to manage your PHP settings directly from your cPanel.
In this guide, you'll learn how to:
-
Switch PHP versions
-
Install or enable PHP extensions
-
Troubleshoot common issues
✅ Why PHP Version and Extensions Matter
Your website’s PHP version can affect:
-
Speed: Newer versions are faster and more secure.
-
Compatibility: Many CMS platforms require a minimum PHP version.
-
Security: Older PHP versions no longer receive security updates.
PHP extensions are like plugins that enable extra functionality. For instance:
-
pdo_mysql
is required for database connections. -
fileinfo
is needed for file uploads in WordPress.
???? How to Switch PHP Versions in cPanel
-
Log in to your cPanel
Access your Sternhost cPanel using your credentials. -
Find "Select PHP Version"
Scroll to the "Software" section and click Select PHP Version. -
Choose Your PHP Version
Use the dropdown to select your desired PHP version (e.g., 8.2 or 8.1).✅ Tip: We recommend PHP 8.1+ for most modern websites.
-
Click "Set as current"
This will apply the selected version to your domain.
???? How to Install or Enable PHP Extensions
After choosing your PHP version:
-
In the Select PHP Version screen, you'll see a list of extensions with checkboxes.
-
Check the boxes for the extensions you need (e.g.,
mbstring
,curl
,intl
,zip
). -
Click Save.
???? Not sure which extensions you need?
Here are some popular platforms and their requirements:
-
WordPress:
mysqli
,curl
,zip
,json
,mbstring
,fileinfo
-
Laravel:
openssl
,pdo
,mbstring
,tokenizer
,xml
,ctype
,bcmath
-
Magento:
soap
,intl
,gd
,sockets
,simplexml
???? Troubleshooting PHP Configuration Issues
-
Changes not showing?
Clear your cache or restart your application (for frameworks). -
Missing PHP selector?
Some hosting plans don’t include the selector. Contact Sternhost Support to upgrade your plan. -
Getting a white screen or 500 error?
This often means an extension is missing. Check your error logs or enabledisplay_errors
.
???? Bonus: Improve Security with PHP
While you're editing your PHP settings, consider:
-
Disabling
exec()
andshell_exec()
functions unless needed. -
Setting
display_errors
to Off in production mode. -
Updating to the latest stable version for security patches.
???? Need Help?
Our support team is available 24/7. Chat with us or check our Knowledge Base for more tips.