当前位置:网站首页>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,停止
边栏推荐
猜你喜欢
响应式织梦模板园林花卉类网站
mysql中添加字段的相关问题
rhcsa 第三次
拳头游戏免版权音乐下载,英雄联盟无版权音乐,可用于视频创作、直播
I have three degrees, and I have five faces. I was "confessed" by the interviewer, and I got an offer of 33*15.
crypto-js uses
special day to remember
从底层结构开始学习FPGA(6)----分布式RAM(DRAM,Distributed RAM)
Golang:go静态文件处理
测试工具(四)Jenkins环境搭建与使用
随机推荐
R语言使用tidyquant包的tq_transmute函数计算持有某只股票的天、月、周收益率、ggplot2使用条形图可视化股票月收益率数据、使用百分比显示Y轴坐标数据、使用不同的色彩表征正负收益率
Srping bean in the life cycle
Image lossless compression software which works: try completely free JPG - C image batch finishing compression reduces weight tools | latest JPG batch dressing tools download
pytest接口自动化测试框架 | 跳过测试类
MySQL row locks and gap locks
小程序更多的手势事件(左右滑动、放大缩小、双击、长按)
05-SDRAM:仲裁
Introduction to the basic principles, implementation and problem solving of crawler
POJ1251丛林之路题解
pytest接口自动化测试框架 | 集成Allure测试报告
Upgrade to heavyweight lock, lock reentrancy will lead to lock release?
七夕来袭——属于程序员的浪漫
奇葩问题 npm install 报错 gyp ERR
对于升级go1.18的goland问题
Golang: go get url and form attribute value
VoLTE基础学习系列 | 企业语音网简述
POJ2031空间站题解
Generate pictures based on the content of the specified area and share them with a summary
阿里三面:MQ 消息丢失、重复、积压问题,该如何解决?
JVM: Runtime Data Area - PC Register (Program Counter)