Helpful Information
 
 
Category: PHP / MySQL
Using Server Sockets with PHP

I get the following error whenever I try to use a socket.

Call to undefined function: socket_create()

I think I need to enable sockets in my php.ini, but how can I do this?

Thanks in advance.

mdueri

The doc says I need to compile php with the following:

--enable-sockets

Do we have any control over this? or does WH have to re-compile php with this option?

I think there is an entry for enable sockets in your php.ini that you can edit.

I can't find the enable-sockets in php.ini
I don't get any error only my script does not execute after socket_create

It looks like we do not have sockets enabled at build time. Try running this code



<?php

$statement="<center>Code from <a href='http://yourcodes.com/index/index.php'>www.YourCodes.com</a></center>";

echo ("$statement");
echo ("<br>");
echo ("<br>");

phpinfo();
?>


I am not sure if we can build our own copies of php, but it might be worth a try - you will have to specify --prefix=/usr/mylocal as we cannot install to /usr/local.

I am not sure if we can build our own copies of php, but it might be worth a try - you will have to specify --prefix=/usr/mylocal as we cannot install to /usr/local.

Somewhere there is an old post about building your own copy of php. Folks where trying to do this before WH offered php 5. It is possible but I think the results where a bit limited.

It looks like the socket functions are working correctly with Php 5.1.2 installed via control panel.

Bogdan










privacy (GDPR)