1)Nginx 1.24.0
2) MySQL 10.5.6-MariaDB
3) PHP-7.4.33
4) phpMyAdmin 5.2
移除:putenv,proc_open,exec,shell-exec
参考
对于客服消息,需要解除(参考):
pcntl_alarm
pcntl_fork
pcntl_wait
pcntl_signal
pcntl_signal_dispatch
disable_functions = passthru,system,chroot,chgrp,chown,popen,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_waitpid,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
修改配置文件 /application/config.php 文件 fastadmin 配置项下的选项 cors_request_domain(如果没有,请自行在 fastadmin 配置项下面自行添加)
//允许跨域的域名,多个以,分隔
'cors_request_domain' => 'localhost,127.0.0.1,您的 h5 域名(无需携带http和端口号)'
配置伪静态/图片跨域(因为前端 h5 生成海报需要下载图片,这里仍然需要配置静态资源跨域)
nginx 配置代码
location / {
if (!-e $request_filename){
rewrite ^(.*)$ /index.php?s=$1 last; break;
}
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp4|ico)$ {
#允许静态资源跨域请求
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' 'GET,POST,OPTIONS';
add_header 'Access-Control-Allow-Headers' 'Origin, X-Requested-With, Content-Type, Accept, token, platform';
expires 30d;
access_log off;
}
php 需要安装 fileinfo, redis, event 扩展
redis配置:
客服队列:
php think shopro:chat start
配置对应的nginx反向代理:
location ^~ /websocket {
proxy_redirect off;
proxy_pass http://127.0.0.1:1819; # 转发
proxy_set_header Host $host;
proxy_set_header X-Real_IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr:$remote_port;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade; # 升级协议头
proxy_set_header Connection upgrade;
}