PHP, Node.js & Python Configuration

How to Change Your PHP Version

By the StarDomain teamPublished 2 min read
Knowledge base article
Contents (4 sections)

Applications such as WordPress, Laravel and Joomla each need a minimum PHP version. Newer versions are faster and still receive security fixes. This guide shows how to switch versions on StarDomain hosting.

Key takeaways

Container Hosting: open the PHP tab in your container panel and choose a version from PHP 7.4 to 8.4. DirectAdmin hosting: use DirectAdmin's PHP version selector. Take a backup first, then check your site after the switch.

1. Container Hosting

  1. Open your container.
    In the client area, open your Container Hosting service.
  2. Open the PHP tab.
    It lists the PHP versions installed on your container (7.4 to 8.4).
  3. Choose a version.
    Switching restarts PHP, so your site pauses for a second or two.
  4. Check your site.
    If something breaks, switch back the same way.

Versions marked EOL no longer receive security updates. Use one only if your application needs it, and plan to move off it.

The same tab changes memory_limit, upload_max_filesize, post_max_size, max_execution_time and display_errors, and turns PHP extensions on or off. Your settings carry over when you switch versions. See PHP Settings and Cron Jobs.

2. DirectAdmin hosting

Change the version from DirectAdmin's PHP version selector. The steps, with per-domain options, are in Changing PHP Version in DirectAdmin.

3. Check which version is running

  • WordPress: Tools › Site Health › Info › Server shows the PHP version.
  • Any site: create phpinfo.php containing <?php phpinfo(); in your web root, open it in the browser, then delete it straight away. It shows details about your server that nobody else should see.

4. If the site breaks after a switch

  • Blank page or error 500: the code may not support the new version. Switch back first, then read the error. On Container Hosting it is in the Logs tab.
  • WordPress plugin errors: update WordPress, your plugins and your theme, then try the newer PHP version again.
  • "Missing extension": turn it on in the PHP tab (Container Hosting) or in DirectAdmin's PHP settings.

See PHP Version Compatibility for which application versions need which PHP version.

Which PHP versions can I use on Container Hosting?

PHP 7.4 to 8.4. Pick one in the PHP tab of your container panel.

Will my PHP settings be lost when I change version?

Not on Container Hosting. Settings apply to every installed version, so they stay after a switch.

Should I back up before switching?

Yes. On Container Hosting, take a backup from the Backups tab first, so you can return to the same point if needed.

Was this article helpful?

Your answer helps us decide what to improve next.

Still need help? Open a support ticket and our team will reply.

Prefer an app? Add this site to your home screen.Get the app
How to Change Your PHP Version