Heim  >  Artikel  >  Backend-Entwicklung  >  PHP7-Installations-Swoole-Tutorial

PHP7-Installations-Swoole-Tutorial

Guanhui
Guanhuinach vorne
2020-05-08 11:01:352743Durchsuche

PHP7-Quellcode-Installation

1. Entpacken Sie tar -xjvf

2. Konfigurieren Sie

4. make install Dateipaket

yum install -y lrzsz

Führen Sie dann

[root@VM_0_5_centos ~]# cd /home/
[root@VM_0_5_centos home]# mkdir -p work/study/softpackage
[root@VM_0_5_centos softpackage]# pwd
/home/work/study/softpackage
[root@VM_0_5_centos softpackage]# ll
total 14900
-rw-r--r-- 1 root root 15235268 Apr  2 21:19 php-7.2.29.tar.bz2
[root@VM_0_5_centos softpackage]# tar -xjvf php-7.2.29.tar.bz2
drwxrwxr-x 14 root root     4096 Mar 17 18:16 php-7.2.29
-rw-r--r--  1 root root 15235268 Apr  2 21:19 php-7.2.29.tar.bz2
[root@VM_0_5_centos softpackage]# cd php-7.2.29/
[root@VM_0_5_centos php-7.2.29]# yum install gcc
----
configure: error: libxml2 not found. Please check your libxml2 installation.
----
//start安装豪华套餐
yum -y install gcc libxml2 yum -y install php-mcrypt libmcrypt libmcrypt-devel autoconf freetype gd jpegsrc libmcrypt libpng libpng-devel libjpeg libxml2 libxml2-devel
//end
[root@VM_0_5_centos php-7.2.29]# ./configure --prefix=/home/work/study/soft/php
[root@VM_0_5_centos php-7.2.29]# make
[root@VM_0_5_centos php-7.2.29]# make install
[root@VM_0_5_centos php-7.2.29]# cd /home/work/study/
[root@VM_0_5_centos study]# ll
total 8
drwxr-xr-x 3 root root 4096 Apr  2 22:04 soft
drwxr-xr-x 3 root root 4096 Apr  2 21:44 softpackage
[root@VM_0_5_centos study]# cd soft/php/
[root@VM_0_5_centos php]# 
[root@VM_0_5_centos php]# ./bin/php -m
//测试
[root@VM_0_5_centos php]# vim test.php
[root@VM_0_5_centos php]# ./bin/php test.php 
1585836467[root@VM_0_5_centos php]# 
//编辑
[root@VM_0_5_centos php]# vi ~/.bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
 . ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
alias php=/home/work/study/soft/php/bin/php
//让配置生效
[root@VM_0_5_centos php]#  source ~/.bash_profile 
[root@VM_0_5_centos php]# php -v
PHP 7.2.29 (cli) (built: Apr  2 2020 22:03:18) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
//测试
[root@VM_0_5_centos study]# mkdir demo
[root@VM_0_5_centos study]# cd demo/
[root@VM_0_5_centos demo]# vim t.php
[root@VM_0_5_centos demo]# php t.php
1585836787[root@VM_0_5_centos demo]# pwd
/home/work/study/demo

aus und fügen Sie Folgendes hinzu: extension=swoole.so

zur php.ini-Datei, um zu überprüfen, ob das Hinzufügen erfolgreich ist: php -m

[root@VM_0_5_centos study]# cd softpackage/php-7.2.29/
[root@VM_0_5_centos php-7.2.29]# pwd
/home/work/study/softpackage/php-7.2.29
[root@VM_0_5_centos php-7.2.29]# cp php.ini-development /home/work/study/soft/php/etc/
[root@VM_0_5_centos ~]# cd /home/work/study/soft/php/etc/
[root@VM_0_5_centos etc]# ll
total 80
-rw-r--r-- 1 root root  1354 Apr  2 22:05 pear.conf
-rw-r--r-- 1 root root 71232 Apr  2 22:17 php.ini-development
[root@VM_0_5_centos etc]# mv php.ini-development php.ini
[root@VM_0_5_centos php-7.2.29]# php -i | grep php.ini
Configuration File (php.ini) Path => /home/work/study/soft/php/lib
[root@VM_0_5_centos php-7.2.29]# cd /home/work/study/soft/php/
[root@VM_0_5_centos php]#  mv ./etc/php.ini ./lib/

Empfohlenes Tutorial: „

PHP7 Tutorial

Das obige ist der detaillierte Inhalt vonPHP7-Installations-Swoole-Tutorial. Für weitere Informationen folgen Sie bitte anderen verwandten Artikeln auf der PHP chinesischen Website!

Stellungnahme:
Dieser Artikel ist reproduziert unter:learnku.com. Bei Verstößen wenden Sie sich bitte an admin@php.cn löschen