Bug #76669 [Com]: Fatal error: Uncaught Error: Call to undefined function socket_create()

From: Date: Thu, 26 Jul 2018 17:25:06 +0000
Subject: Bug #76669 [Com]: Fatal error: Uncaught Error: Call to undefined function socket_create()
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-216481@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=76669&edit=1

 ID:                 76669
 Comment by:         spam2 at rhsoft dot net
 Reported by:        michael_r_monteith at yahoo dot com
 Summary:            Fatal error: Uncaught Error: Call to undefined
                     function socket_create()
 Status:             Not a bug
 Type:               Bug
 Package:            Sockets related
 Operating System:   Windows 7 Pro
 PHP Version:        7.2.8
 Block user comment: N
 Private report:     N

 New Comment:

php -m is your friend or in doubt phpinfo()

[harry@srv-rhsoft:~]$ php -m
[PHP Modules]
apcu
bz2
calendar
Core
ctype
curl
date
dom
exif
fileinfo
filter
gd
geoip
hash
iconv
imagick
imap
intl
json
libxml
mailparse
mbstring
mysqli
mysqlnd
openssl
pcntl
pcre
Phar
posix
readline
Reflection
session
SimpleXML
soap
sockets
SPL
standard
tidy
tokenizer
xml
xmlwriter
zip
zlib


Previous Comments:
------------------------------------------------------------------------
[2018-07-26 17:22:10] michael_r_monteith at yahoo dot com

I didn't get back here fast enough.  Sorry.
Yes and it's working now.  I guess for future reference:
1. copy one of the example ini files.  I used production and copied to php.ini
2. added a line :
extension=php_sockets.dll

------------------------------------------------------------------------
[2018-07-26 17:06:21] requinix@php.net

Did you enable the sockets extension?

------------------------------------------------------------------------
[2018-07-26 17:00:47] michael_r_monteith at yahoo dot com

Description:
------------
$ php -v
PHP 7.2.8 (cli) (built: Jul 18 2018 10:03:03) ( ZTS MSVC15 (Visual C++ 2017) x64 )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

$sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);

error:
Fatal error: Uncaught Error: Call to undefined function socket_create() in
C:\Users\mmonteith\Desktop\Location Scanning\telnetserver.php:4
Stack trace:
#0 {main}
  thrown in C:\Users\mmonteith\Desktop\Location Scanning\telnetserver.php on line 4


Test script:
---------------
<?php
$sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);

socket_close($sock);
?>


Actual result:
--------------
Should complete with no error and allow me to work with the open socket.


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=76669&edit=1


Thread (4 messages)

« previous php.bugs (#216481) next »