Home > Operation and Maintenance > Linux Operation and Maintenance > How to install php under linux

How to install php under linux

王林
Release: 2020-11-03 10:12:10
Original
3556 people have browsed it

How to install PHP under Linux: 1. Download the PHP source code; 2. Unzip the installation package; 3. Configure the installation variables; 4. Compile the source code; 5. Switch to the root user and execute the [make install] command to install php.

How to install php under linux

Environment:

linux system

php5.6

The specific steps are as follows:

(Recommended tutorial: linux video tutorial)

1. Download the php source code

Download the php installation source code package from the official website of php.

2. Decompress the installation package

The downloaded installation package is in compressed gz format. In Linux, you can use the built-in tool tar to decompress it. Execute the command in the directory where the installation package is located:

tar -zxvf php-5.5.11.tar.gz
Copy after login

3. Configure installation variables

Open the decompressed directory - execute the command:

cd php-5.5.11
Copy after login

Configure the installation environment - execute the command:

(recommended graphic tutorial : linux tutorial)

./configure --prefix=/usr/local/servers/php
Copy after login

"/usr/local/servers/php" is the installation path, which can be changed to your favorite installation path.

4. Compile the source code

Execute the compilation command in the decompression directory:

make
Copy after login

5. Install php

Switch to the root user-execute the command:

sudo su root
Copy after login

Installation-Execute command:

make install
Copy after login

Create soft link: Execute command:

ln -s /usr/local/servers/php/bin/php /usr/local/bin/php
Copy after login

Related recommendations: php training

The above is the detailed content of How to install php under linux. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template