2

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

4

1 回答 1

3

从命令行键入以下命令:

php --ini

这将告诉您正在加载哪个 php.ini 文件。我怀疑您正在从命令行运行 websockets,并且您的 php 在 CLI 模式下正在初始化不同的配置文件。

于 2013-10-14T17:47:37.670 回答