VB.net 2010 视频教程 VB.net 2010 视频教程 python基础视频教程
SQL Server 2008 视频教程 c#入门经典教程 Visual Basic从门到精通视频教程
当前位置:
首页 > 网站开发 > PHP >
  • php教程之PHP7 安装 Swoole 教程

本站最新发布   C#从入门到精通
试听地址  
https://www.xin3721.com/eschool/CSharpxin3721/

PHP7 源码安装

 

步骤

1、解压 tar -xjvf

2、configure

3、make

4、make install

安装上传下载命令

1
yum install -y lrzsz

  

linux 操作

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
[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
相关教程