我如何运行 websocket 服务器。我正在使用 WampServer 2.1
它在标题中说得很清楚。 附带的 apache 服务器中运行 websocket 服务器的方法,
我想要一种在 Wamp 2.1更新
请检查此页面 http://net.tutsplus.com/tutorials/javascript-ajax/start-using-html5-websockets-today/ 查看步骤 9,其中描述了如何运行 Websocket 服务器。那是 XAMPP 的。我想在 WAMP 中进行。抱歉,如果不清楚。
udate 2
我尝试按照照片中的方式运行它,但是,如您所见,我正在这样做错误的。抱歉,我不擅长命令行。您能告诉我运行 websocket-server
update 3
的确切方法吗?再次尝试,没有任何反应。
it says it clearly in the heading. I want a way to run a websocket server in apache server that comes with Wamp 2.1
update
check this page http://net.tutsplus.com/tutorials/javascript-ajax/start-using-html5-websockets-today/ look at step 9 where it describes how to run a websocket server. that's for XAMPP. I want to do it in WAMP. Sorry if it was unclear.
udate 2
I tried to run it as in the photo but ,as you see, I'm doing that wrong. sorry guys I'm not good at command lines. could you please show me the exact way to run the websocket-server
update 3
another trial and nothing happened.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我找到了一些让 WAMP 与教程一起工作的想法。
您需要编辑 C:\wamp\bin\php\php5.3.9\php.ini 并添加一行 extension=php_sockets.dll ,然后调用 php -q C:\wamp cmd 中的 \www\websocket\server\startDaemon.php 并且 websocket 将工作。
P/S:我认为还有另一种方法,无需手动编辑 php.ini。单击 WAMP 图标 PHP -> PHP 扩展 -> PHP Socket 并勾选它。我想它也会起作用。
I have found some idea to make WAMP work with the tutorial.
You need to edit the C:\wamp\bin\php\php5.3.9\php.ini and add a line extension=php_sockets.dll and then call php -q C:\wamp\www\websocket\server\startDaemon.php in cmd and the websocket will work.
P/S: I think there is another way without edit php.ini manually. Click on WAMP Icon PHP -> PHP Extensions -> PHP Socket and Tick it. I guess it will work too.
您唯一需要的是 shell/终端/命令行(无论您选择的操作系统如何称呼它),在其中键入:
其中
php
是 PHP 可执行文件的路径,后跟选项-q
后跟脚本的路径。这实际上并不依赖于 (X/W/M)AMP。The only thing you need is a shell/terminal/command line (whatever your operating system of choice calls it) in which you type:
Where
php
is the path to the PHP executable followed by the option-q
followed by the path to your script. This doesn't really depend on (X/W/M)AMP much.