To install PHP 7 on Ubuntu 14.04 LTS, follow these steps:
- Add the repository for PHP 7:
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ondrej/php
- Update the package list:
sudo apt-get update
- Install PHP 7:
sudo apt-get install php7.0
This will install the latest version of PHP 7 available in the repository. You can also install specific packages, such as php7.0-cli
or php7.0-fpm
, by specifying the package name after apt-get install
.
- Verify the installation:
To verify that PHP 7 has been installed correctly, you can run the following command:
php -v
This will display the version of PHP that is currently in use.
Note that you may need to restart any services that use PHP, such as Apache or Nginx, for the changes to take effect.