6月26日安装centos 7 mariadb 、php、swoole,现做以简单记录:
1、安装centos7
设置ip:192.168.1.71
cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)
2、yum install mariadb
启动mariadb: systemctl start mariadb
然后mysql就可以用了。
【附mariadb数据库的相关命令是:
systemctl start mariadb #启动MariaDB
systemctl stop mariadb #停止MariaDB
systemctl restart mariadb #重启MariaDB
systemctl enable mariadb #设置开机启动】
3、下载php
cd /opt/
wget https://www.php.net/distributions/php-7.4.7.tar.gz
tar xvf php-7.4.7.tar.gz
4、安装php
cd php-7.4.7
# ./configure –prefix=/opt/php/
【./configure 过程中报错:no package ‘libxml-2.0‘ found缺失libxml2.0 库,解决方法:
yum -y install libxml2
yum -y install libxml2-devel】
make
make install
5、配置php
将安装文件中的php.ini-development 复制到 /opt/php/lib 中,改名为 php.ini
修改~ .bash_profile 的$PATH ,添加/opt/php/bin至 $PATH
source .bash_profile 使PATH配置立即生效。
6、下载swoole
git clone https://github.com/swoole/swoole-src.git
在/opt/下 clone了 /swoole-src/
此目录无configure。
7、生成swoole的configure
在/opt/swoole-src 下运行/opt/php/bin/phpize
在swoole-src 下就有了configure
8、安装swoole
./configure
make
make install
自动安装至以下路径:
Installing shared extensions: /opt/php/lib/php/extensions/no-debug-non-zts-20190902/
修改/opt/php/lib/php.ini
在相应位置添加 extension=swoole