PHP7.2, git, swoole installation

Source: Internet
Author: User
Tags fpm install php

First, install PHP

1. Installing GCC

Yum-y Install GCC gcc-c++

2. Install some libraries

1
Libpng-devel Freetype-devel Libmcrypt-devel

3. Download PHP

http://cn2.php.net/distributions/php-7.2.4.tar.gz

4. Configuration parameters

./configure--prefix=/usr/local/PHP7--with-config-file-path=/usr/local/php7/etc--with-mysqli=Mysqlnd--with-pdo-MySQL=Mysqlnd--with-MySQL-sock=/tmp/MySQL.sock--enable-Mysqlnd--with-GD--with-Iconv --with-zlib--enable-Bcmath--enable-Shmop--enable-Sysvsem--enable-inline-optimization--enable-Mbregex--enable-FPM--enable-mbstring--enable-FTP--with-OpenSSL--enable-Pcntl--enable-Sockets--with-Xmlrpc--enable-Zip--enable-Soap--with-GetText--with-Curl--with-jpeg-dir --with-freetype-dir

5. Compiling

Makemkae Install

6. Configure PHP

CP Php.ini-development/usr/local/php7/etc/php.ini

7. Join

vim/usr/local/php7/etc/php. inizend_extension=/usr/local/php7/lib/php/extensions/no-debug-non-zts-20151012/opcache.so

Copy php-fpm.conf

Cp/usr/local/php7/etc/php-fpm.conf. default /usr/local/php7/etc/php-fpm.conf

Edit php-fpm.conf, change PID to/run/php-fpm.pid

VIM/USR/LOCAL/PHP7/ETC/PHP-FPM.  =/run/php-fpm.pid

Edit PHP-FPM configuration www.conf is loaded in php-fpm.conf

Cp/usr/local/php7/etc/php-fpm.d/www.conf. default /usr/local/php7/etc/php-fpm.d/www.conf

Add PHP-FPM Manager to Systemctl

vim/usr/lib/systemd/System/php-fpm.service

Press I to write the following:

[Unit]description= thePHP FastCGI Process managerafter=syslog. Target network. target[service]type=simplepidfile=/run/php-fpm. pidexecstart=/usr/local/php7/sbin/php-fpm--nodaemonize--fpm-config/usr/local/php7/etc/php-fpm. Confexecreload $MAINPID Execstop $MAINPID [Install]wantedby=multi-user.target

Start PHP-FPM

Systemctl Start Php-fpm.service

Add to boot Boot

Systemctl Enable Php-fpm.service

Down machine for SYSTEMCTL instruction
Systemctl Enable *.service #开机运行服务
Systemctl Disable *.service #取消开机运行
Systemctl Start *.service #启动服务
Systemctl Stop *.service #停止服务
Systemctl Restart *.service #重启服务
Systemctl Reload *.service #重新加载服务配置文件
Systemctl Status *.service #查询服务运行状态
Systemctl--failed #显示启动失败的服务

Modify php.ini File Settings expose_php = Off
Vim/usr/local/php7/etc/php.ini
Find expose_php = On
Change to expose_php = Off

Second, install Git

1. Installation dependencies

Yum-y Install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-extutils-makemaker autoconf

2. Download

wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.9.5.tar.gz

3. Decompression

4. Configuration parameters

CD Git-2.9.5/./configure prefix=/usr/local/git/

5. Compile and install

Makemake Install

6. Edit the profile file and add export path= to the last line $PATH:/usr/local/git/bin

vi/etc/profileexport PATH=$PATH:/usr/local/git/bin

7. Refresh the file

Source/etc/profile

Third, Swoole installation

1. Download Swoole

Clone https://gitee.com/swoole/swoole.git

2. Expansion module

/usr/local/php7/bin/phpize

3. Configuration parameters

./configure--with-php-config=/usr/local/php7/bin/php-config

4. Compile and install

Makemake Install

5. Edit PHP.ini Add swoole (about 900 rows or so)

VI PHP. iniextension=swoole

6. Restart PHP

Systemctl Restart Php-fpm.service

7. See if the Swoole module is added

Php-m

8. Testing

cd/usr/local/src/swoole/examples/echo. php
Netstat-anp|grep 9501

PHP7.2, git, swoole installation

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.