dongzao4503 2013-09-06 06: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 09: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.

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

报告相同问题?

手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部