What is PHP?

PHP is the server-side programming language used by WordPress, Joomla, Drupal, and most dynamic websites. Different PHP versions offer different features, performance improvements, and security updates.

Why change PHP version?

  • Performance: Newer PHP versions are significantly faster (PHP 8.1 is 2–3Γ— faster than PHP 7.4)
  • Security: Older versions no longer receive security updates
  • Compatibility: New WordPress versions require PHP 7.4+
  • Plugin requirements: Some plugins require specific PHP versions
  • Legacy applications: Older websites may need older PHP versions

Available PHP versions at 0724 Hosting

0724 Hosting provides multiple PHP versions:

  • PHP 8.3 - Latest stable (recommended for new sites)
  • PHP 8.2 - Stable, well-supported
  • PHP 8.1 - Widely compatible, good performance
  • PHP 8.0 - Stable, losing support
  • PHP 7.4 - Legacy compatibility (end-of-life November 2022)

Note: Availability may vary by server. Contact support if you need a specific version.

PHP version recommendations

Scenario Recommended Version
New WordPress site PHP 8.1 or 8.2
Existing WordPress (updated) PHP 8.1 or higher
WordPress with old plugins PHP 7.4 or 8.0 (test first)
Custom PHP application Check application requirements
Legacy CMS (Joomla 2.x, Drupal 7) PHP 7.4 (upgrade CMS if possible)
WooCommerce store PHP 8.1 or 8.2

Before changing PHP version

1. Check website compatibility

Not all websites work with newer PHP versions. Before upgrading:

  • Update WordPress, plugins, and themes to the latest versions
  • Check plugin compatibility: Visit each plugin's page on wordpress.org and verify PHP 8.x support
  • Test on staging site: Create a copy of your website to test the new PHP version first
  • Back up your website: Use JetBackup or export files and database before changing PHP version

2. Common compatibility issues

  • Deprecated functions: Older code may use functions removed in newer PHP versions
  • Plugin incompatibility: Abandoned or unmaintained plugins may break
  • Theme issues: Old themes may have PHP compatibility problems
  • Custom code: Hardcoded PHP may need updates

Method 1: Changing PHP version in DirectAdmin

Step 1: Access PHP version settings

  1. Log in to DirectAdmin
  2. Go to Domain Setup or Advanced Features
  3. Click PHP Version Selection or Select PHP Version
  4. Select your domain from the dropdown (if you have multiple domains)

Step 2: Choose PHP version

  1. You will see a list of available PHP versions
  2. Select the PHP version you want (e.g., PHP 8.2)
  3. Click Save or Apply

The change applies immediately. No web server restart required.

Step 3: Verify the PHP version

Create a file called info.php in your public_html folder with this content:

<?php phpinfo(); ?>

Visit https://yourdomain.co.za/info.php in your browser. The page displays your current PHP version and configuration.

Security tip: Delete info.php after checking the version (it exposes server configuration details).

Method 2: Per-domain PHP version (advanced)

If you host multiple domains and need different PHP versions for each:

  1. Go to Domain Setup in DirectAdmin
  2. Find the domain in the list
  3. Click Modify or the domain name
  4. Select PHP Version from the options
  5. Choose the desired PHP version
  6. Click Save

Each domain can run a different PHP version independently.

Method 3: Using .htaccess (directory-specific)

To set PHP version for a specific directory (e.g., subdirectory or subdomain):

  1. Navigate to the directory in File Manager or FTP
  2. Create or edit the .htaccess file
  3. Add this line (adjust version number):
AddHandler application/x-httpd-php82 .php

Note: The exact syntax varies by server configuration. Contact support for the correct handler name.

Testing after PHP version change

Essential tests

  1. Homepage: Visit your website and verify it loads
  2. WordPress admin: Log in to /wp-admin and check for errors
  3. Forms: Test contact forms, search, and other interactive elements
  4. E-commerce: Test checkout, product pages, cart functionality (if applicable)
  5. User login: Test member login areas
  6. Images and media: Verify images, videos, and galleries work

Check for PHP errors

Enable WordPress debugging to see PHP errors:

  1. Edit wp-config.php in your website root
  2. Add these lines before /* That's all, stop editing! */:
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);

Check wp-content/debug.log for PHP errors. Disable debugging after testing.

Common PHP version upgrade issues

White screen of death (WSOD)

If your website shows a blank white screen after upgrading PHP:

  • Cause: Fatal PHP error preventing page rendering
  • Fix: Revert to previous PHP version immediately
  • Troubleshooting: Check error logs (DirectAdmin β†’ Error Logs)
  • Solution: Update or replace incompatible plugins/themes

"Fatal error: Uncaught Error..."

Fatal error messages indicate code incompatibility:

  • Identify the plugin/theme: Error message usually includes the file path
  • Update or replace: Update the problematic plugin or find an alternative
  • Contact developer: Request PHP 8.x compatibility update
  • Temporary fix: Revert to previous PHP version until issue is resolved

Warnings or deprecation notices

Non-critical warnings (e.g., "Deprecated function...") may appear:

  • Don't panic: Warnings do not break your site
  • Log them: Note which plugins/themes generate warnings
  • Update software: Update WordPress, plugins, and themes
  • Suppress warnings: Disable WP_DEBUG_DISPLAY (warnings are logged, not shown)

Plugins or features stop working

If specific functionality breaks:

  • Disable plugins one by one: Identify the problematic plugin
  • Check plugin compatibility: Some plugins do not support PHP 8.x
  • Switch themes temporarily: Test if the issue is theme-related
  • Update or replace: Find updated alternatives

Rolling back to previous PHP version

If the new PHP version causes problems:

  1. Go to DirectAdmin β†’ PHP Version Selection
  2. Select the previous PHP version (e.g., PHP 7.4)
  3. Click Save
  4. The website should return to normal immediately

Don't panic: PHP version changes are reversible and instant.

PHP version lifecycle and support

PHP Version Release Date End of Life Status
PHP 8.3 November 2023 December 2026 βœ… Actively supported
PHP 8.2 December 2022 December 2025 βœ… Actively supported
PHP 8.1 November 2021 November 2024 ⚠️ Security fixes only
PHP 8.0 November 2020 November 2023 ❌ End of life
PHP 7.4 November 2019 November 2022 ❌ End of life

Security risk: PHP versions past end-of-life no longer receive security updates. Upgrade to PHP 8.1+ as soon as possible.

Performance improvements by PHP version

Benchmarks show significant performance gains with newer PHP versions:

  • PHP 8.0: 20–30% faster than PHP 7.4
  • PHP 8.1: 5–10% faster than PHP 8.0
  • PHP 8.2: 5–10% faster than PHP 8.1
  • PHP 8.3: Minor performance improvements over 8.2

WordPress benchmark (requests per second):

  • PHP 7.4: 100 req/s
  • PHP 8.0: 130 req/s (+30%)
  • PHP 8.1: 140 req/s (+40% vs 7.4)
  • PHP 8.2: 150 req/s (+50% vs 7.4)

Upgrading PHP is one of the easiest ways to improve website speed.

WordPress and PHP compatibility

WordPress minimum PHP requirements:

  • WordPress 6.4+: PHP 7.4 minimum, PHP 8.1+ recommended
  • WordPress 6.0–6.3: PHP 7.4 minimum, PHP 8.0+ recommended
  • WordPress 5.9: PHP 7.4 minimum
  • Older WordPress: May require PHP 5.6–7.3 (upgrade WordPress first)

Best practice: Always run the latest WordPress version with the latest stable PHP version.

Getting help with PHP version changes

If you need assistance upgrading PHP, troubleshooting compatibility issues, updating plugins, or testing staging environments, contact 0724 Hosting support. We can help identify incompatible plugins, test PHP upgrades, and resolve errors.