Hezy, Im trying to use socket programming, I need a background service. I tried a simple example:
if (($sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP)) === false) {
echo "socket_create() failed: reason: " . socket_strerror(socket_last_error()) . "\n";
if I try it in the browsers, it works…
but with php.exe on command line, it doesnt work… it says socket_create() doesn’t exists. But sockets are enabled. Now what? I dont have another php.ini in Windows directory
The command line php.exe might use another php.ini than the php module that’s used by Apache, so the sockets extension isn’t loaded for command line.
Try executing
php.exe -ito see which php.ini it’s using, and enable the appropriate extension in there.