当前位置:网站首页>centos 安装php7.4,搭建hyperf,转发RDS
centos 安装php7.4,搭建hyperf,转发RDS
2022-08-01 07:19:00 【游鱼_】
安装php7.4,搭建hyperf
8 sudo yum install epel-release
9 sudo yum -y install https://rpms.remirepo.net/enterprise/remi-release-7.rpm
10 sudo yum -y install yum-utils
11 sudo yum-config-manager --enable remi-php74
12 sudo yum install php php-cli php-fpm php-mysqlnd php-zip php-devel php-gd php-mcrypt php-mbstring php-curl php-xml php-pear php-bcmath php-json php-redis php74-php-pecl-swoole4
13 php -v
14 php --ri swoole
15 yum wget
16 yum install wget
17 cd /home
18 mkdir temp
19 cd temp
20 wget https://github.com/swoole/swoole-src/archive/refs/tags/v4.5.11.tar.gz
21 tar -zxvf v4.5.11.tar.gz
22 cd swoole-src-4.5.11/
23 phpize
24 openssl version
25 openssl
26 ./configure
27 make
28 make install
29 vim /etc/php.ini
30 yum install -y vim
31 vim /etc/php.ini
32 php --ri swoole
33 yum install -y lrzsz
34 yum -y install docker
35 systemctl start docker
36 docker -v
有时RDS不请允许本地所在区域登录,就在服务器做个中转
安装nignx,做端口数据转发
在nginx.conf最后面加上
stream{
include /etc/nginx/conf.d/*.stream;
}
在conf.d里创建一个mysql.stream的文件
upstream tcpLink {
hash $remote_addr consistent;
server database-1.cr.ap-southeast-1.rds.amazonaws.com:3306 weight=5 max_fails=3 fail_timeout=30s;
}
server {
listen 8087;
proxy_connect_timeout 1s;
proxy_timeout 3s;
proxy_pass tcpLink;
}
运行nginx后会报错:
nginx: [emerg] unknown directive "stream" in /etc/nginx/nginx.conf:84
需要安装stream模块
在这比较懒,直接全装了
yum install -y nginx-all-modules
hyperf项目装好后,用docker运行
docker build -t admin-api:1.0.1 .
docker run --rm -p 9501:9501 -d --name admin-api admin-api:1.0.1
//进入docker
docker exec -it admin-api /bin/bash
记录几个docker命令
docker ps 列出当前运行的image
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
5135a12fc06c admin-api:1.0.1 "php /opt/www/bin/..." 17 hours ago Up 17 hours 0.0.0.0:9501->9501/tcp admin-api
docker stop 513 根据上面CONTAINER ID,停止
边栏推荐
- Generate pictures based on the content of the specified area and share them with a summary
- Golang: go static file processing
- Upgrade to heavyweight lock, lock reentrancy will lead to lock release?
- 【南瓜书ML】(task4)神经网络中的数学推导(更新ing)
- Explosive 30,000 words, the hardest core丨Mysql knowledge system, complete collection of commands [recommended collection]
- rhcsa 第四天
- LevelSequence源码分析
- curl (7) Failed connect to localhost8080; Connection refused
- 我的创作纪念日
- sum of special numbers
猜你喜欢
升级为重量级锁,锁重入会导致锁释放?
Explosive 30,000 words, the hardest core丨Mysql knowledge system, complete collection of commands [recommended collection]
Motion analysis and parameter optimization of crank-slider mechanism
mysql中添加字段的相关问题
Information system project managers must recite the work of the core test site (56) Configuration Control Board (CCB)
sum of special numbers
Srping bean in the life cycle
MVVM项目开发(商品管理系统一)
Srping中bean的生命周期
MVVM project development (commodity management system 1)
随机推荐
Classwork (7) - #598. remainder operation (mod)
Golang:go连接和使用mysql
crypto-js uses
从购买服务器到网站搭建成功保姆级教程~超详细
Motion analysis and parameter optimization of crank-slider mechanism
配置我的kitty
Fist game copyright-free music download, League of Legends copyright-free music, can be used for video creation, live broadcast
pytest接口自动化测试框架 | parametrize叠加使用
Json对象和Json字符串的区别
Dart 异常详解
pytest接口自动化测试框架 | 跳过模块
日志导致线程Block的这些坑,你不得不防
上课作业(7)——#598. 取余运算(mod)
安装SQL Server详细教程
C语言学习概览(三)
国内外最顶级的8大plm项目管理系统
三维坐标系距离
LeetCode Question of the Day (309. Best Time to Buy and Sell Stock with Cooldown)
rhcsa 第四天
第02章 MySQL的数据目录【1.MySQL架构篇】【MySQL高级】