The method for lunx to install php7 is: 1. Use the "Ctrl alt t" key combination to open the terminal; 2. Add the PHP7 repository; 3. Update the Repository. After adding the PPA repository, update the system package list to Make the repository available; 4. Install PHP7.0 and other required components; 5. After completing the installation, verify whether "PHP -v" is successfully installed and the version number will appear.
The operating system of this tutorial: Linux5.18.14 system, php7 version, Dell G3 computer.
The following are the specific steps to install php7 on Ubuntu:
1. Start the terminal:
On Ubuntu, you can press the "Ctrl Alt T" key combination to Open a terminal.
2. Add PHP7 repository:
Add Ondřej Surý’s PHP PPA repository to the system using the following command:
``` sudo add-apt-repository ppa:ondrej/php ```
3. Update Repository:
After adding the PPA repository, update the system package list to make the repository available. Please use the following command:
``` sudo apt-get update ```
4. Install PHP7.0 and its related components:
Use the following command to install PHP7.0 and other required components:
``` sudo apt-get install php7.0 php7.0-cli php7.0-fpm php7.0-mysql php7.0-curl php7.0-gd php7.0-mcrypt php7.0-json php7.0-sqlite3 php7.0-mbstring php7.0-xml php7.0-zip ```
5 . Verify installation:
After completing the installation, please verify whether PHP7.0 has been successfully installed. Type the following command to check the version number of PHP:
``` php -v ```
If the installation is successful, the version number of PHP 7.x will be output (where "x" is the next number). Now, you have successfully installed PHP7.0!
Hope these steps are helpful to you.
The above is the detailed content of How to install php7 on lunx. For more information, please follow other related articles on the PHP Chinese website!