<small id='Okiz2'></small><noframes id='Okiz2'>

    1. <i id='Okiz2'><tr id='Okiz2'><dt id='Okiz2'><q id='Okiz2'><span id='Okiz2'><b id='Okiz2'><form id='Okiz2'><ins id='Okiz2'></ins><ul id='Okiz2'></ul><sub id='Okiz2'></sub></form><legend id='Okiz2'></legend><bdo id='Okiz2'><pre id='Okiz2'><center id='Okiz2'></center></pre></bdo></b><th id='Okiz2'></th></span></q></dt></tr></i><div id='Okiz2'><tfoot id='Okiz2'></tfoot><dl id='Okiz2'><fieldset id='Okiz2'></fieldset></dl></div>

        • <bdo id='Okiz2'></bdo><ul id='Okiz2'></ul>
        <tfoot id='Okiz2'></tfoot>
        <legend id='Okiz2'><style id='Okiz2'><dir id='Okiz2'><q id='Okiz2'></q></dir></style></legend>

        在没有 http 的情况下从同一服务器上的 php 向 ngnix 发送信息

        Sending information to a ngnix from php on the same server without http(在没有 http 的情况下从同一服务器上的 php 向 ngnix 发送信息)
            <tfoot id='R5zI3'></tfoot>
          1. <small id='R5zI3'></small><noframes id='R5zI3'>

                <tbody id='R5zI3'></tbody>
              <legend id='R5zI3'><style id='R5zI3'><dir id='R5zI3'><q id='R5zI3'></q></dir></style></legend>
              <i id='R5zI3'><tr id='R5zI3'><dt id='R5zI3'><q id='R5zI3'><span id='R5zI3'><b id='R5zI3'><form id='R5zI3'><ins id='R5zI3'></ins><ul id='R5zI3'></ul><sub id='R5zI3'></sub></form><legend id='R5zI3'></legend><bdo id='R5zI3'><pre id='R5zI3'><center id='R5zI3'></center></pre></bdo></b><th id='R5zI3'></th></span></q></dt></tr></i><div id='R5zI3'><tfoot id='R5zI3'></tfoot><dl id='R5zI3'><fieldset id='R5zI3'></fieldset></dl></div>
                  <bdo id='R5zI3'></bdo><ul id='R5zI3'></ul>
                • 本文介绍了在没有 http 的情况下从同一服务器上的 php 向 ngnix 发送信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我们正在开发一个实时应用程序,我们正在将 nginx 推送流模块用于 websockets 部分.首先,数据从客户端发送到 php 脚本,该脚本执行一些身份验证并将所需信息存储在数据库中,然后将信息推送到 nginx,然后将其发送给特定套接字上的订阅用户.经常会出现从该脚本向本地 nginx 发出超过 30 个 http 请求的情况(我不确定这是一件坏事吗?).

                  We are developing a realtime app and we are using nginx push stream module for a websockets part. Firstly, data is send from a client to a php script that does some authentication and stores needed information in database and then pushes information to nginx that later sends it to a subscribed users on a specific sockets. Quite often there will be situations when there are more that 30 http requests made from this script to local nginx (which I am not exactly sure is a bad thing?).

                  问题
                  是否可以在没有 http 请求的情况下将信息从 php 发送到 nginx?有什么方法可以让我的 php 脚本与 nginx 通信?处理这种通信的最佳做法是什么?每个 php 脚本发送 30+ 个 http 请求是一个好习惯吗?

                  Question
                  Is it possible to send information from php to nginx without http requests? Is there any way that my php script can communicate with nginx? What is a best practise to handle this kind of communications? Is sending 30+ http requests per php script a good practise?

                  我已经阅读了一些 AMQP 解决方案,但没有找到 nginx 是来自 rabbitmq 消息的消费者的信息.

                  I have read towards some AMQP solutions but haven't found information where nginx is a consumer of messages from rabbitmq.

                  如果有不清楚的地方,我很乐意提供任何其他信息.

                  I will gladly provide any additional information if something is not clear.

                  推荐答案

                  我假设如下:

                  当前工作流程:

                  1. 用户从命令行运行 php 脚本,该脚本使用 http 请求与 Nginx 中的服务器端脚本/cgi 设置进行通信
                  2. Nginx 中的服务器端脚本/cgi 将获取传入的数据,对其进行处理并将其放入数据库中,或发送给最终用户

                  OP 问题:

                  命令行 php 脚本使用 http 协议与 Nginx 服务器端脚本通信的效率,由于通信发生在同一服务器内,这可能会有点过分.

                  Efficiency of command line php script communicating with Nginx server side script using http protocol, which maybe overkill as the communication happen within the same server.

                  提案 1

                  1. 命令行 php 脚本将所有信息写入文件,然后向 Nginx 服务器端 cgi 脚本发送一个 http 请求
                  2. Nginx 服务器 cgi 脚本,在收到请求后,将拾取所有来自文件的信息,然后对其进行处理
                  3. ramfs(ram 磁盘)可用于最小化物理硬盘的 I/O

                  提案 2

                  将您的命令行 php 脚本组合到 Nginx 服务器端脚本中,并为其创建一个 Web 界面.当前命令行用户将登录网页以控制他们使用命令行工具执行此操作的过程.

                  Combine your command line php script into the Nginx server side script, and create a web interface for it. Current command line user will login webpage to control the process they used to do it with command line tool.

                  专业人士:不再有脚本间/进程间通信.整个工作流程在一个过程中.这可能在未来也更具可扩展性,因为多个用户可以通过 Web 界面登录并远程处理该过程.此外,它们不需要操作系统级别的帐户.

                  Pro: No more inter-scripts/inter-process communication. The whole work flow is in one process. This maybe more scalable for the future also, as multiple users can log in through web interface and handle the process remotely. Additionally, they do not require OS level accounts.

                  缺点:可能需要更多的开发时间.(但你只需要维护一个代码库而不是两个.)

                  Con: May need more development time. (But you only have to maintain one code base instead of two.)

                  这篇关于在没有 http 的情况下从同一服务器上的 php 向 ngnix 发送信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)
                    <tfoot id='6BHWz'></tfoot>
                    <i id='6BHWz'><tr id='6BHWz'><dt id='6BHWz'><q id='6BHWz'><span id='6BHWz'><b id='6BHWz'><form id='6BHWz'><ins id='6BHWz'></ins><ul id='6BHWz'></ul><sub id='6BHWz'></sub></form><legend id='6BHWz'></legend><bdo id='6BHWz'><pre id='6BHWz'><center id='6BHWz'></center></pre></bdo></b><th id='6BHWz'></th></span></q></dt></tr></i><div id='6BHWz'><tfoot id='6BHWz'></tfoot><dl id='6BHWz'><fieldset id='6BHWz'></fieldset></dl></div>
                    • <bdo id='6BHWz'></bdo><ul id='6BHWz'></ul>

                        <small id='6BHWz'></small><noframes id='6BHWz'>

                          <tbody id='6BHWz'></tbody>

                        <legend id='6BHWz'><style id='6BHWz'><dir id='6BHWz'><q id='6BHWz'></q></dir></style></legend>