VPS Special Offer: Get 20% OFF Your First Month + 10% OFF Monthly Renewals, or Save 20% When You Go Yearly

Changing PHP Version for a Website

Changing PHP Version HostsNix comes with multiple PHP versions pre-installed (8.1, 8.2, and 8.3), and you can switch between them on a per-website basis. This allows you to run different…

Changing PHP Version#

HostsNix comes with multiple PHP versions pre-installed (8.1, 8.2, and 8.3), and you can switch between them on a per-website basis. This allows you to run different PHP versions for different websites on the same server — perfect for supporting both legacy applications and cutting-edge frameworks.

How to Change PHP Version#

Follow these steps to switch the PHP version for any website:

  1. Navigate to Websites from the sidebar
  2. Find the website you want to modify in the list
  3. Click the settings gear icon (⚙️) in the Actions column
  4. In the “Edit Website” dialog, select “PHP Settings”
  5. Choose your desired PHP version from the dropdown menu
  6. Click “Save Changes”

The panel automatically updates the Nginx configuration to point to the correct PHP-FPM socket and reloads the web server. The change takes effect immediately with zero downtime.

PHP Version Compatibility Guide#

Not sure which PHP version to use? Here’s a quick compatibility reference:

PHP 8.1 (Long-Term Support)

  • WordPress 6.0 and newer
  • Laravel 9 and 10
  • Drupal 10
  • Most mature plugins and themes
  • Security support until December 2025

PHP 8.2 (Recommended)

  • WordPress 6.3 and newer
  • Laravel 10 and 11
  • Drupal 10 and 11
  • Best balance of compatibility and performance
  • Active security support

PHP 8.3 (Latest)

  • WordPress 6.4 and newer
  • Laravel 11
  • Best performance with latest optimizations
  • Some older plugins may not yet be compatible

Editing php.ini Settings#

In the same PHP Settings dialog, you can also edit the php.ini configuration for this website. Common settings you might want to adjust:

  • upload_max_filesize — Maximum file upload size (default: 128M)
  • post_max_size — Maximum POST request size (default: 128M)
  • memory_limit — PHP memory limit per script (default: 256M)
  • max_execution_time — Maximum script execution time in seconds (default: 300)
  • max_input_vars — Maximum number of input variables (default: 3000)

???? Tip: If you’re running a WooCommerce store or a site with many custom fields, increasing max_input_vars to 5000+ can prevent data loss when saving large forms.

Troubleshooting PHP Changes#

Site shows errors after switching PHP version? Some PHP functions and behaviors change between versions. If your site breaks after switching, simply go back to the PHP Settings and select the previous version. The rollback is instant.

Changes to php.ini not taking effect? PHP-FPM caches its configuration. The panel automatically restarts PHP-FPM when you save changes, but if settings seem unchanged, try clearing your application’s cache (e.g., php artisan cache:clear for Laravel).

Follow HostsNiX on Google