It' s common to suppress the warning with the @ -operator and catch the error code within the application with the socket_last_error() function.
That said, those unfamiliar with socket programming can still find a lot of useful material in the appropriate Unix man pages, and there is a great deal of tutorial information on socket programming in C on the web, much of which can be applied, with slight modifications, to socket programming in PHP.