سكيب إلى ماين محتوى

Knowledge Base

How to Change PHP Version and Extensions in cPanel Safely

بقلم Pakish Support Team6 دقيقة قراءةcPanel
مشاركة & الذكاء الاصطناعي

باختصار

أبرز النقاط

  • How to Change PHP Version and Extensions in cPanel Safely Change PHP version in cPanel using Select PHP Version — check compatibility, enable extensions, test WordPress, read error logs, and roll back safely.
  • Change your PHP version in cPanel through Select PHP Version or MultiPHP Manager under the Software section.
  • Select a supported version from the dropdown, enable required extensions (mysqli, curl, mbstring, zip), back up your site first, and test WordPress or your application immediately.

ملخّص من مجموعة باكيش (باكيش.نت) للاستشهاد بالذكاء الاصطناعي والبحث.

Change your PHP version in cPanel through Select PHP Version or MultiPHP Manager under the Software section. Select a supported version from the dropdown, enable required extensions (mysqli, curl, mbstring, zip), back up your site first, and test WordPress or your application immediately. Roll back to the previous version if you see errors in cPanel error logs or a white screen.

See the cPanel beginner's guide for dashboard basics. WordPress issues? Read known WordPress bugs.


Key Takeaways

  • Select PHP Version sets version + extensions; MultiPHP Manager assigns per domain
  • Back up before any PHP change
  • Check plugin/theme compatibility before upgrading
  • Enable only required extensions
  • Test front-end and admin after changing version
  • Roll back immediately on fatal errors

Before You Start

| Item | Action | |---|---| | Backup | JetBackup 5 or Backup Wizard | | Current version | Note active PHP in Select PHP Version | | Compatibility | Check plugin/theme changelogs for PHP support | | Scope | Change only the domain you intend to affect |

Create or confirm a usable backup first. Availability and limits may vary by hosting plan or server configuration. Available PHP versions depend on your server — select from the versions listed in your cPanel interface.


Select PHP Version vs MultiPHP Manager

| Tool | Purpose | |---|---| | Select PHP Version | Choose PHP version and toggle extensions | | MultiPHP Manager | Assign different PHP versions per domain on multi-site accounts | | MultiPHP INI Editor | Adjust PHP directives (memory_limit, upload_max_filesize) |

Your cPanel 134 interface may show one or more of these under Software.


Check the Currently Active PHP Version

Method 1 — cPanel UI

  1. Open Select PHP Version
  2. Read the version shown as current or native

Method 2 — phpinfo file (temporary)

  1. Create public_html/phpinfo.php with <?php phpinfo(); ?>
  2. Visit https://example.com/phpinfo.php
  3. Note the PHP version
  4. Delete the file immediately — it exposes server details

Change PHP Version for the Correct Domain

  1. Open Select PHP Version or MultiPHP Manager
  2. If using MultiPHP Manager, select example.com from the domain list
  3. Choose a supported PHP version from the dropdown (only versions shown are available on your server)
  4. Click Apply, Set as current, or Save depending on the interface
  5. Do not change unrelated domains on multi-site accounts

Enable Required Extensions

In Select PHP Version → Extensions (or Options):

| Extension | Often needed for | |---|---| | mysqli / mysqlnd | WordPress database | | curl | HTTP requests, updates | | mbstring | Multibyte strings | | zip | Plugin/theme updates | | gd or imagick | Image processing | | intl | Internationalization |

Check your application documentation for the exact list.


Compatibility Checks Before Upgrading

  • WordPress core: check WordPress requirements
  • Plugins/themes: read changelogs for PHP 8.x support
  • Custom PHP code: test on staging or during low-traffic window
  • Outdated PHP: running unsupported versions is a security risk — plan upgrades deliberately

WordPress-Specific Considerations

After PHP change:

  1. Visit /wp-admin/ and front page
  2. Check Tools → Site Health for PHP recommendations
  3. Update plugins and themes that show compatibility warnings
  4. See WSOD fixes if the site goes blank

Testing After a PHP Change

  1. Load homepage and key pages
  2. Test forms, checkout, and login
  3. Open cPanel → Metrics → Errors (or Error Log)
  4. Look for PHP Fatal error lines timestamped after your change

Roll Back

  1. Return to Select PHP Version / MultiPHP Manager
  2. Select the previous PHP version
  3. Save and retest
  4. Restore from backup if files were modified during troubleshooting

Outdated and Unsupported PHP Versions

cPanel may still list older PHP versions for legacy apps. Running end-of-life PHP exposes security vulnerabilities. Migrate applications to supported versions rather than staying on deprecated releases.


How to Verify It Worked

  • Site and admin load without errors
  • Error log shows no new fatal errors
  • phpinfo (temporary) or Select PHP Version confirms new version
  • Plugin-dependent features (forms, shop) work correctly

Common Problems and Fixes

| Problem | Fix | |---|---| | White screen | Roll back PHP; disable plugins via File Manager | | 500 Internal Server Error | Check error log; increase memory_limit in INI Editor | | Missing extension | Enable in Select PHP Version extensions | | One domain affected others | Use MultiPHP Manager per-domain assignment | | Upload fails | Adjust upload_max_filesize in MultiPHP INI Editor |


When to Contact Pakish Support

Contact support if required PHP version is unavailable, custom extensions are needed, or errors persist after rollback. Managed WordPress hosting includes compatibility-tested PHP stacks. Visit /support.


Frequently Asked Questions

What is the difference between Select PHP Version and MultiPHP Manager?

Select PHP Version sets the PHP version and extensions for your account or domain depending on server configuration. MultiPHP Manager assigns PHP versions per domain when multiple sites share one account. Your interface may show one or both tools.

Will changing PHP version break my WordPress site?

It can, if plugins or themes are incompatible with the new version. Back up first, check plugin compatibility notes, upgrade on staging if possible, and roll back immediately if you see errors.

Which PHP extensions does WordPress typically need?

Common extensions include mysqli or mysqlnd, curl, mbstring, xml, zip, gd or imagick, and intl. Enable only what your application requires in Select PHP Version extensions panel.

How do I roll back PHP version after an upgrade fails?

Return to Select PHP Version or MultiPHP Manager, select the previous PHP version for the affected domain, save, and clear any opcode cache if available. Verify the site loads and check error logs.

Can I set different PHP versions for different domains on one account?

Yes, when MultiPHP Manager is available. Select each domain and assign its PHP version independently without affecting unrelated domains.


Let Pakish handle PHP compatibility with managed WordPress hosting — tested stacks, staging, and expert support.


Sources

فووند هذا وسيفول?

مشاركة تقنية المعلومات مع لك فريق أو اسأل تشات جي بي تي, جيميناي, بيربليكسيتي, كلود, أو كوبايلوت لـ أ ثانية وبينيون.

PS

عن المؤلف

Pakish Support Team

The Pakish Support Team provides 24/7 technical assistance, hosting tutorials, and knowledge base articles to help Pakistani businesses manage their web presence with confidence.