php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76669 Fatal error: Uncaught Error: Call to undefined function socket_create()
Submitted: 2018-07-26 17:00 UTC Modified: 2018-07-26 17:06 UTC
From: michael_r_monteith at yahoo dot com Assigned:
Status: Not a bug Package: Sockets related
PHP Version: 7.2.8 OS: Windows 7 Pro
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
42 - 24 = ?
Subscribe to this entry?

 
 [2018-07-26 17:00 UTC] 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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-07-26 17:06 UTC] requinix@php.net
-Status: Open +Status: Not a bug
 [2018-07-26 17:06 UTC] requinix@php.net
Did you enable the sockets extension?
 [2018-07-26 17:22 UTC] 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:25 UTC] spam2 at rhsoft dot net
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
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 19:01:31 2024 UTC