Fatal Error: Call to Undefined Function Socket_Create()

Fatal error: Call to undefined function socket_create()

You'll need to install (or enable) the Socket PHP extension: http://www.php.net/manual/en/sockets.installation.php

Fatal error: Call to undefined function socket_create() even though enabled in php.ini

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.

phpwebsocket - Undefined Function socket_create() - Have php_sockets enabled on Windows/WAMP

Found the answer in another thread:

Error with PHP Websocket and Wamp Server

Turns out running the file on the command line means it uses a different php.ini file than the WAMP server does. Seems stupid, but turned out php_sockets wasn't uncommented in that php.ini file, and removing it removed the error with it.



Related Topics



Leave a reply



Submit