• php 开启socket配置


    我在Windows命令行输入命令:C:wampinphpphp5.2.6php.exe getXml.php以执行php文件。

    出现错误:Fatal error: Call to undefined function socket_create() in C:wampwwwgetXml.php on line 13

    网上搜了挺多论坛上的Q&A贴子,答案基本上是:
    1. 找到php.ini,看  extension=php_sockets.dll 扩展是否打开,将前面的注释删去。
    2. phpInfo()显示的内容里,socket模块是否为enable;

    还有说是少了一些dll文件,但是下了php4ts.dllphp5ts.dllphp_mime_magic.dll并将它们拷到目录C:/Windows/system32下,并确认php目录下的ext文件夹下存在php_sockets.dll文件,结果还是没有解决问题。

    解决方案: 这是在一个英文论坛上看到的方案,经过实践证明是可行的。

    原文是:

    The command prompt uses a different php.ini file to the apache server.

    The Apache php.ini file is accessible via the taskbar icon, and is located at:
    X:WAMP INSTALL DIRApache2inphp.ini

    The command prompt php.ini file is located at:
    X:WAMP INSTALL DIRphpphp.ini

    Once I’d enabled sockets in this file, by uncommenting the line:
    extension=php_sockets.dll
    and restarted the server, everything worked great.

    在两个目录下都有php.ini  我们使用wamp 的管理界面直接修改的php.ini是位于:

    C:wampinapacheapache2.2.8inphp.ini 下的(因个人安装的目录而不同),事实证明我确实在这个php.ini文件中修改了php_sockets.dll前面的注释符号”;”  ,但为什么没有用呢?

    那是因为在另外一个目录: C:wampinphpphp5.2.6php.ini(也因个人的安装而不同)中的扩展没有修改, 而我们只需修改它,就行了,  再拷一份修改后的php,ini文件到目录C:Windows目录下。

  • 相关阅读:
    A. Dreamoon and Stairs(Codeforces Round #272)
    bootstrap之UpdateStrings
    FZU
    IT忍者神龟之 oracle行转列、列转行
    linux find 10天内改动过的文件
    内核调试日志打印宏
    ack-grep 代码全文搜索
    JDK配置 linux
    IDA修改游戏
    curl 访问https问题
  • 原文地址:https://www.cnblogs.com/mrcln/p/5639933.html
Copyright © 2020-2023  润新知