PHP Version

OVIPanel provides a module named PHP Version where you can change versions which is suitable for a domain present in a particular account.Default PHP version is PHP 5.6 under VPS, Cloud or Dedicated server.If you can't get something to work and think it might be because you have the wrong version of PHP, there is a really simple way to check the current version. create a file and Just put the single line of code in a PHP file.





run it on your server to get all the PHP information you need.

Different versions of PHP may have different default settings, and in the case of newer versions, might have new functions.The newer versions have huge performance improvements, great features, and better security.Latest PHP version is PHP 7 and it is a major upgrade compared to the last stable version of the language, PHP 5.6. Although upgrading your code from PHP 5.6 to PHP 7 involves carefully checking for incompatibilities, both in your code and in any libraries on which your code depends on, the benefits of upgrading to PHP 7 make the effort very worthwhile. PHP 7 performs much faster than PHP 5.6, which allows sites that use the new version of the language to offer much better service to their users.

Before Upgrading PHP versions remember these points:

1. First, you need to make sure that any libraries that your PHP project uses are available for PHP 7. If the libraries do not yet support PHP 7, you may have to hold off on upgrading for a while, or see if it is possible to remove dependence on those libraries.

2. If your code is written in PHP 5.5 or PHP 5.6, then upgrading will likely be straightforward. However, if you use PHP 4, then there are some syntax changes that you should be aware of. For example, the old style of constructor functions employed in PHP 4 is not supported in PHP 7, even though these constructors worked in PHP 5.

3. When upgrading to PHP 7, it is best to ensure that your code includes tests, such as unit and integration tests. These tests should catch any issues with your application before they show up as bugs in a live environment.

Steps to Upgrade PHP Version:

Step1: Login to server as a root user and run the below 2 commands:



It will take around 1 hour for PHP multiple versions installation. Once it is done login to OVIPanel and Go to PHP version where you can see the Versions under drop-down menu. You can select the appropriate versions for your projects.