dongzao4503 2013-09-06 14:00
浏览 80
已采纳

“致命错误:调用未定义的函数socket_create()”即使在php.ini中启用

I have a weird PHP problem. I am running PHP 5 on IIS in Windows 7. When I make a call to socket_create in my PHP file, like so:

$sock = socket_create(AF_INET, SOCK_DGRAM, getprotobyname('udp'));

I get the following error:

Fatal error: Call to undefined function socket_create() ...

I have tried everything, ranging from enabling extension=php_sockets.dll in php.ini, php.ini-development and php.ini-production to restarting IIS and rebooting my computer.

However, I keep getting the same error and am confused. So far I have found no solution on the internet, as I have tried everything.

Also worth of mentioning. The dll is clearly installed in one of the subfolders.

Any ideas?

Thanks

  • 写回答

1条回答 默认 最新

  • doupafu6980 2013-10-14 17:47
    关注

    Type in the following command from your command line:

    php --ini
    

    That will tell you which php.ini file is being loaded. I suspect you are running websockets from the command line, and your php is initializing a different config file when in CLI mode.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 iqoo11 如何下载安装工程模式
  • ¥15 本题的答案是不是有问题
  • ¥15 关于#r语言#的问题:(svydesign)为什么在一个大的数据集中抽取了一个小数据集
  • ¥15 C++使用Gunplot
  • ¥15 这个电路是如何实现路灯控制器的,原理是什么,怎么求解灯亮起后熄灭的时间如图?
  • ¥15 matlab数字图像处理频率域滤波
  • ¥15 在abaqus做了二维正交切削模型,给刀具添加了超声振动条件后输出切削力为什么比普通切削增大这么多
  • ¥15 ELGamal和paillier计算效率谁快?
  • ¥15 蓝桥杯单片机第十三届第一场,整点继电器吸合,5s后断开出现了问题
  • ¥15 file converter 转换格式失败 报错 Error marking filters as finished,如何解决?