当前位置:网站首页>PHP laravel+gatewayworker completes im instant messaging and file transfer (Chapter 1: basic configuration)
PHP laravel+gatewayworker completes im instant messaging and file transfer (Chapter 1: basic configuration)
2022-06-26 12:21:00 【Special sword】
laravel+GatewayWorker complete IM Instant messaging and file transfer ( Chapter one : Basic configuration )
Effect display

Function introduction
This topic will lead you to build Imitation A letter Of Instant messaging And complete the mutual transmission of documents
Application scenarios
Practical application scenarios of this topic :
- Chat customer service : Instant messaging , Messages are transmitted to each other in real time , Send text to each other 、 Voice messages and files ;
- Small scale online auction ;
- Video live barrage ;
- The Internet of things ;
- And other functions related to real-time messages ;
Special sections
- Server configuration
- Explanation of business logic
- Back end instant messaging code development and configuration item explanation
- Server debugging error
- Front and back end code development
- Function display
Chapter one : Configuration article
One 、 The tools needed
1. One server
2.laravel Basic mine construction
3. Basic development environment ( My server environment Linux+Nginx+PHP+Redis+Mysql) Be careful :wss Service requirements PHP edition >=5.6, Because wechat applet requires tls1.2, and PHP5.6 The following versions are not supported tls1.2, It doesn't matter if you don't understand , You use it directly >=php7 Just the version of
4. domain name ( Optional , If there is no domain name, we use the public network IP It can also be realized )
5. Domain name HTTPS certificate ( Optional )
Two 、 Configure server
1. Develop necessary ports , according to GatewayWorker manual
to open up
registerAddress Register service address port :1238
websocket Protocol port :8282
Redis Service port :6379
Be careful registerAddress Register service address port And websocket Protocol port this 2 Ports are customized , It doesn't have to be the same as my open port, just make sure that 2 Ports are not occupied , Also note : Port cannot be greater than 65535, Please make sure that the port is not occupied by other programs , Otherwise start will report an error . If the port is less than 1024, need root Permission to run GatewayWorker To have permission to listen , Otherwise, an error is reported and there is no permission
2. This is my port opening status 
3. For the convenience of demonstration, I choose the pagoda panel here , If you are also a pagoda panel user, please open your port again on this page according to your actual needs , Otherwise, the server security group will be opened , The pagoda panel does not open the corresponding port , The port is still unavailable ;
4. Start downloading the necessary extensions
- redis expand ( It's not necessary to pretend , It is mainly used to save temporary chat records )
- Swoole4 expand
- imagemagick(Imagick High performance graphics library )
- fileinfo expand ( Without this extension, the front end of the address may not be able to upload files to php)
- Be careful : I have installed the corresponding extensions , But the actual code development does not take effect , Pay attention to php Disable function problem of , Go to see if there are any dangerous functions that have been disabled, causing the functions to not work .


5. To configure Redis Extended password 
Next chapter :《2. Explanation of business logic 》
边栏推荐
- Pre knowledge of hash table -- binary search tree
- Jmeter响应时间和tps监听器使用教程
- Is it safe to open a securities account
- 24 database interview questions that must be mastered!
- 【概率论】条件概率、贝叶斯公式、相关系数、中心极限定理、参数估计、假设检验
- 11、 Box styles and user interface
- I'd like to know what preferential activities are available for stock account opening? Is it safe to open an account online?
- 我想知道,十大劵商如何开户?在线开户安全么?
- How to calculate flops and params in deep learning
- On the use of protostaff [easy to understand]
猜你喜欢

1、 MySQL introduction

Ctrip ticket app KMM cross end kV repository mmkv kotlin | open source

Ctfshow web getting started command execution web75-77

Pre knowledge of hash table -- binary search tree

统计遗传学:第二章,统计分析概念

HUST network attack and defense practice | 6_ IOT device firmware security experiment | Experiment 2 MPU based IOT device attack mitigation technology

SQL injection in Pikachu shooting range

Mqtt disconnect and reconnect

Prospering customs through science and technology, Ronglian and Tianjin Customs jointly build a genomic database and analysis platform

国际美妆业巨头押注中国
随机推荐
File decryption in webgame development
Five problems and solutions of member operation
Is it safe to open an account in the top ten securities app rankings in China
Scala-day01- companion objects and HelloWorld
NFS共享存储服务安装
Measures to support the development of cultural and creative industries in Futian District, Shenzhen
MOS管基本原理,单片机重要知识点
CG骨骼动画
【Redis 系列】redis 学习十六,redis 字典(map) 及其核心编码结构
I'd like to know what preferential activities are available for stock account opening? Is it safe to open an account online?
HUST network attack and defense practice | 6_ IOT device firmware security experiment | Experiment 3 freertos-mpu protection bypass
1、 MySQL introduction
Omnichannel membership - tmall membership 1: opening tutorial
2022 edition of investment analysis and "fourteenth five year plan" development prospect forecast report of China's switchgear industry
Redis cannot connect to the server through port 6379
Five strategies and suggestions of member marketing in consumer goods industry
哈希表的前置知识---二叉搜索树
Omnichannel membership - tmall membership 2: frequently asked questions
Mqtt disconnect and reconnect
JMeter response time and TPS listener tutorial