How to install php from the command line under linux

王林
Release: 2020-09-29 10:22:04
Original
3096 people have browsed it

How to install PHP from the command line under Linux: 1. Download the PHP source code and decompress it; 2. Enter the decompression directory and configure the installation environment; 3. Execute the [make] command to compile; 4. Execute [make install] command to install.

How to install php from the command line under linux

【Download php source code】

(Recommended tutorial: linux tutorial)

From php Download the PHP installation source code package from the official website.

[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

[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:

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

"/usr/ "local/servers/php" is the installation path, you can change it to your favorite installation path.

[Compile source code]

Execute the compilation command in the decompression directory:

make
Copy after login

[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 from the command line 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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!