How to Enable Sockets Extension for PHP

A socket is the backbone of network communication, it establishes the connection between client and server, as well as messages transmission between them.

In PHP, the socket extension implements a low-level interface to the socket communication functions based on the popular BSD sockets, providing the possibility to act as a socket server as well as a client.

Check if Sockets Support is enabled

The phpinfo() function displays information about Sockets. The state is determined by whether Sockets Support is enabled or disabled.

Sockets is enabled

How to enable Sockets support in PHP ?

Socket extension is packed into PHP when it is installed. However, this extension is not enabled by default. You need to enable it to start using PHP’s socket functions.

The name of this extension is php_sockets.dll. It can be found in php\ext.

php_sockets.dll in Windows’ XAMPP

To enable sockets, you need to add the following line to php.ini file.


Leave a Comment

Your email address will not be published. Required fields are marked *

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.