【发布时间】:2015-01-04 23:08:41
【问题描述】:
我正在尝试使用 Laravel 4 设置一个实时聊天应用程序,如下所述:https://xuri.me/2014/09/08/laravel-4-real-time-chat.html
我在 Hostmonster 上有一个共享主机帐户,具有专用 IP 地址。我可以通过 SSH 连接到 Web 服务器并使用 Artisan 命令启动 BrainSocket Ratchet WebSocket 服务器,在端口 8080 上运行它。但是,Hostmonster 的 PHP 进程超时为 2 小时。
我可以通过运行 Artisan 命令以使用 Supervisor 将 WebSocket 服务器作为 PHP 守护程序启动来避免这种情况。如果 WebSocket 服务器停止,Supervisor 也会自动重启。我的目标是让 WebSocket 服务器与 Supervisor 一起运行,如下所示:https://xuri.me/2014/09/09/run-brainsocket-laravel-artisan-command-in-supervisor.html
我使用这种方法成功安装了 Python (2.7.8)。我使用 easy_install 方法安装了带有 Setuptools 的 Supervisor。我测试了Supervisor已成功安装在Python中。我创建了一个主管配置文件(supervisord.conf)。
显示 Python bindir 和 pythonpath 的 .bashrc 文件的一部分:
导出 PYTHONPATH=$HOME/python/lib/python2.7/site-packages:$PYTHONPATH
导出 PATH=$HOME/python/bin:$PATH
当我在 Python bindir 中输入“supervisord”命令时,Supervisor 无法启动并出现以下错误:
回溯(最近一次通话最后一次):
文件“/home3/thecdeor/python/bin/supervisord”,第 9 行,在
load_entry_point('supervisor==3.1.3', 'console_scripts', 'supervisord')()
文件“/home3/thecdeor/python/lib/python2.7/site-packages/supervisor-3.1.3-py2.7.egg/supervisor/supervisord.py”,第 366 行,在 main go(options)
文件“/home3/thecdeor/python/lib/python2.7/site-packages/supervisor-3.1.3-py2.7.egg/supervisor/supervisord.py”,第 376 行,在 go d.main()
文件“/home3/thecdeor/python/lib/python2.7/site-packages/supervisor-3.1.3-py2.7.egg/supervisor/supervisord.py”,第 70 行,主要 rlimit_messages = self.options.set_rlimits ()
文件“/home3/thecdeor/python/lib/python2.7/site-packages/supervisor-3.1.3-py2.7.egg/supervisor/options.py”,第 1316 行,在 set_rlimits self.usage(msg % locals ())
KeyError: 'min'。
我不明白这个错误是什么意思。我已经搜索了互联网试图弄清楚,但似乎没有其他人有这个错误。
当我在 Python bindir 文件夹中输入“supervisorctl”命令时,出现以下错误:
unix:///home3/thecdeor/python/bin/tmp/supervisor.sock 没有这样的文件
我对这些错误感到困惑。任何人都可以帮忙吗?如果我目前的声誉允许我这样做,我会发布更多链接。如果您需要更多服务器信息或任何其他信息,请告诉我。我以前从来没有在 StackOverflow 上发过帖子,也从来没有遇到过这样的问题,所以我不太确定要发布什么信息以及发布多少信息。
【问题讨论】:
标签: python laravel-4 websocket supervisord ratchet