Home>Article>Backend Development> How to install php on linux

How to install php on linux

王林
王林 Original
2019-10-16 16:14:35 4355browse

How to install php on linux

1. Check whether php is installed

1. yum installation check:

yum list installed |grep php

2. rpm installation check:

rpm -qa |grep php

2. Download and install php

1. Use wget to download the tar.gz file of php: wget http://br2.php.net/get/php- 7.2.2.tar.gz

2. Unzip the tar.gz file: tar zxvf php-7.2.2.tar.gz

3. Create a new folder where php will be installed later: mkdir /usr/local/php, and then enter the decompressed PHP installation package folder and configure configure

3. Configure PHP related files

1 , configure php.ini, this is the php configuration file

cp /home/myload/php-7.2.2/php.ini-development /usr/local/php/lib/php.ini

2, configure php-fpm.conf, this is the php-fpm configuration file

cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf

3, configure www.conf, configure User’s file

cp etc/php-fpm.d/www.conf.default etc/php-fpm.d/www.conf

4. Copy the php-fpm startup file to the init.d folder to facilitate starting php

cp -R sbin/php-fpm /etc/init.d/php-fpm

4. Start PHP

Command:

/etc/init.d/php-fpm

Check whether it is started:

ps -ef |grep php

Recommended tutorial:PHP video tutorial

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

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