PHP’s php command is linked to /usr/bin/php, which is symlinked to /etc/alternatives/php, which again is symlinked to actual PHP, example /usr/bin/php7.2. PHP can be used as a CLI or web server module (mod_php, CGI, FPM).
Now a big question is: How to use a specific PHP version as per application?īefore that, we should know how PHP is used. Similarly, you can install PHP 7.3 and it’s related modules. Now, you have a new PHP 7.2 version and required modules installed. To search the PHP module: sudo apt-cache search php7.2 To check installed PHP modules: php -m | grep -E 'bcmath|ctype|curl|dom|gd|hash|iconv|intl|json|mbstring|mcrypt|openssl|pdo|soap|spl|xml|xsl|zip' You can install the most commonly needed modules especially required for Magento 2 with: sudo apt install php7.2-mysql php7.2-bcmath php7.2-curl php7.2-xml php7.2-gd php7.2-intl php7.2-mcrypt php7.2-mbstring php7.2-soap php7.2-zip You may need some additional PHP modules in order for PHP to work with your applications. If php -v still pointing to the old PHP version, then run the following command sudo update-alternatives -set php /usr/bin/php7.2 Install PHP 7.2 Modules Now you are able to install the new version of PHP sudo apt install -y php7.2-fpm Run the following commands to update the PHP repository & the Ubuntu system sudo apt install software-properties-common So want to learn how to install multiple versions of PHP on the Ubuntu system? Okay, that’s great.Īnd want to install PHP 7.2. But I want to stay away as much as possible from third-party tools and try to leverage the native as much as I can. that gives you the power to achieve the multiple versions of PHP in your system. There are many tools like Docker, Vagrant, VirtualBox, etc. Home » Linux » How to Install Multiple Versions of PHP on Ubuntu? jQuery Lightboxes (Fancybox, Pirobox, Lightbox Clone, prettyPhoto).