How to Change PHP Version

How to Change the PHP Version

Lvato allows you to easily change the PHP version for your hosting account. You can also run multiple websites with different PHP versions on the same hosting package using a .htaccess file.

This guide explains both methods.

Method 1: Change the PHP Version from Your Lvato Account

Follow these steps to change the PHP version for your hosting service.

  1. Log in to your Lvato account: Visit lvato.com/login and sign in.
  2. Select your hosting service: From the navigation menu, open the Services dropdown and select the hosting service you want to manage.
  3. Open PHP Version settings: On the service management page, click the PHP Version tab.
  4. Choose a PHP version: You will see a list of available PHP versions, including the currently active version.
  5. Activate your preferred version: Select the PHP version you want to use and click Save.
  6. Wait for the changes: Allow a little time for the new PHP version to be applied.

Your selected PHP version will now be active for your hosting account.

Method 2: Use Different PHP Versions for Multiple Websites

If you host multiple websites on the same Lvato hosting package, you can configure each website to use a different PHP version.

For example, your main website can use PHP 8.5, while a second website uses PHP 7.4.

Step 1: Open the Hosting Control Panel

  1. Log in to your Lvato account.
  2. Go to Services and select your hosting package.
  3. Click the Control Panel button to open your hosting control panel.
  4. Navigate to File Manager.

Step 2: Find Your Website Directory

In File Manager, open the directory containing the website you want to configure.

For example:

  • public_html — Your primary website directory.
  • public_html2 — Your second website directory, if configured.

Make sure you are editing the correct website directory.

Step 3: Edit or Create the .htaccess File

  1. Open your website's directory.
  2. Look for a file named .htaccess.
  3. Double-click the file to open it in the editor.
  4. If the file does not exist, create a new file named .htaccess and open it.

Note: If you cannot see the .htaccess file, enable the option to show hidden files in File Manager, if available.

Step 4: Set Your Preferred PHP Version

At the very top of the .htaccess file, add the appropriate PHP handler for the version you want to use.

PHP 8.5

AddHandler x-httpd-php85 .php

PHP 7.4

AddHandler x-httpd-php74 .php

PHP 5.6

AddHandler x-httpd-php56 .php

Only add the handler for the PHP version you want to activate.

Step 5: Save Your Changes

  1. Click Save in the file editor.
  2. Close the editor.
  3. Allow a little time for the changes to take effect.

Your website should now use the PHP version configured in its .htaccess file, provided that version and handler are supported by your hosting service.

Example: Running Two Websites with Different PHP Versions

Suppose you have two websites hosted under the same Lvato hosting package.

Website Directory PHP Version .htaccess Configuration
public_html PHP 8.5 AddHandler x-httpd-php85 .php
public_html2 PHP 7.4 AddHandler x-httpd-php74 .php

Each website can run its own PHP version without requiring a separate hosting package.

How to Verify Your PHP Version

You can check which PHP version your website is running by creating a PHP information file.

  1. Open your website directory in File Manager.
  2. Create a file named phpinfo.php.
  3. Add the following code:
<?php
phpinfo();
  1. Save the file.
  2. Open https://yourdomain.com/phpinfo.php in your browser.

The page will display your active PHP version and PHP configuration.

Important: Delete the phpinfo.php file after checking your version, as it exposes server configuration information.

Important Notes

  • Always check that your website, plugins, themes, and applications are compatible before changing the PHP version.
  • PHP versions available to you depend on your hosting package and server configuration.
  • PHP 5.6 and PHP 7.4 are no longer officially supported and should only be used for legacy applications when absolutely necessary.
  • Incorrect .htaccess directives can cause website errors. If this happens, remove the handler you added and save the file again.
  • Changing the PHP version may take a short time to apply.

Need Help?

If you experience any issues while changing your PHP version, our support team is here to help.

Visit Lvato to contact our support team for assistance with your hosting account.