VestaCP, often known as vesta, is the most widely used, free, and open-source hosting software. It has been running on PHP 7.2 up until this point. But I’ll show you how to install or upgrade php7.4 in Vesta. Let’s start by looking at the current PHP version.
# php -v
The command’s output will appear as follows.
The second option is to create a phpinfo.php file in the root directory and add the line “<?PHP phpinfo();?>” without the quotes.
$ nano phpinfo.php
In this file, the only thing we need to do is call upon the
phpinfo function, which can be done with the following line of code:
Copy and paste this command:
<?php phpinfo(); ?>
Safe and close the file.
Refresh or browse the web page after restarting the apache2 service. http://example.com or IP address/phpinfo.php will be your URL.
The PHP version has been tested and verified. Version 7.2 is the most recent release. Let’s get php7.4 installed and configured on the vesta.
Install the PHP pap repository and the program’s common properties.
Common properties and the PHP PPA repository are installed after the software is installed. Install php7.4 as well as the most common extensions.
PHP 7.4 has been successfully installed. Let’s double-check the PHP version using both techniques. Refreshing or visiting the website after using the PHP -v command. The PHP -v command indicates that the PHP version has been upgraded to 7.4, however, the website or vesta does not recognize the upgrade. PHP7.2 is still in use. Due to apache’s continued use of php7.2. We need to disable php7.2 and enable php7.4 with apache2 to fix this problem. Also, the apache2 service should be restarted.
Apache2 now connects to php7.4, and Vesta works perfectly with it.
Yes, we were able to upgrade to PHP 7.4. We may now uninstall php7.2 from the system and verify that everything is operating properly.
Restart your computer. Everything should now be in working order. The issue will be unable to access PHPMyAdmin and Roundcube email if several popular extensions of PHP 7.4 are missing.Install those extensions and restart the vesta system as a whole, or the PHP-fpm, Apache2, and vesta services individually.