Fatal Error Call To Undefined Function Socket_create Php.ini
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Fatal error: Call to undefined function socket_create() up vote 21 down vote favorite 2 My code is like this: if( ($this->master=socket_create(AF_INET,SOCK_STREAM,SOL_TCP)) < 0 ) { die("socket_create() failed, reason: ".socket_strerror($this->master)); } when I run my php file which create connection with web socket, I got error Fatal error: Call to undefined function socket_create() in the line if( ($this->master=socket_create(AF_INET,SOCK_STREAM,SOL_TCP)) < 0 ) Therefore i am not able to connect web socket and also not able to get response message from socket because Socket Status: 3 (Closed) is displaying in my browser when run client page . Have you got an idea what is missing? Thank you in advance. php share|improve this question edited Nov 20 '14 at 13:41 PeeHaa 40.8k33134216 asked May 26 '11 at 11:36 Sanjeev Kumar Jha 4622619 1 is sockets enabled in your configuration? –martynthewolf May 26 '11 at 11:38 Do you have the extension enabled in your php.ini? (check phpinfo()). –Wesley van Opdorp May 26 '11 at 11:39 Yes socket support enabled and browser is also support for web socket. –Sanjeev Kumar Jha May 26 '11 at 12:28 add a comment| 2 Answers 2 active oldest votes up vote 34 down vote accepted You'll need to install (or enable) the Socket PHP extension: http://www.php.net/manual/en/sockets.installation.php share|improve this answer answered May 26 '11 at 11:38 Jan Hančič 31.3k136983 did this work for you? –mrBorna Aug 11 '11 at 19:08 1 I just had to uncomment it in my php.ini; I also had to copy it from another directory to the PHP directory, but it came with the installation. –Bob Jul 20 '12 at 13:16 Thanks Bob. i am using wamp server. First i changed in apache's php.ini and no effect. Then, i also changed in php's php.ini. At the end, websocket server started. :) –balamurugan Oct 4 '14 at 10:19 I have enabled socket extension in both php.ini but it still giving me same error. Do you guys have any idea why this would happen? –Aryan Feb 5 at 12:36 add a comment| up vote 2 down vote For a typical XAMPP install on windows you pro
Sign in Pricing Blog Support Search GitHub This repository Watch 465 Star 2,704 Fork 1,333 mgp25/Chat-API Code Issues 1 Pull requests 0 Projects 0 Wiki Pulse Graphs New issue Call to undefined function socket_create() #208 Closed orsgah opened this Issue Dec 13, 2014 · 4 comments Projects None yet Labels None yet Milestone No milestone Assignees No one assigned 3 participants orsgah commented Dec 13, 2014 Fatal error: http://stackoverflow.com/questions/6137823/fatal-error-call-to-undefined-function-socket-create Call to undefined function socket_create() in /Users/dmitrijvitalevic/sites/src/whatsprot.class.php on line 468 If i use old version(2 weeks later) all work fine, but if i use newer catch this error. Same problem on windows and os x. I am try to re install php, uncoment extension in php.ini but problem didn't gone. Thanks eliasjnior commented Dec https://github.com/mgp25/Chat-API/issues/208 13, 2014 socket_create() is a PHP function, not something from WhatsAPI. May be it's some problem in yout WAMP installation? Look up here: http://php.net/manual/en/function.socket-create.php eliasjnior commented Dec 13, 2014 Oh, sorry, I didin't think that. It's probably because the socket PHP extension isn't installed. orsgah commented Dec 13, 2014 extension=php_sockets.dll enabled in php.ini and old version whatsprot.class.php worked fine. Owner mgp25 commented Dec 13, 2014 You'll need to install (or enable) the Socket PHP extension: http://www.php.net/manual/en/sockets.installation.php It is also explained in the wiki - Dependencies mgp25 closed this Dec 13, 2014 Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment Contact GitHub API Training Shop Blog About © 2016 GitHub, Inc. Terms Privacy Security Status Help You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
this is your first visit, be sure to check out the http://board.phpbuilder.com/showthread.php?10274229-Fatal-error-Call-to-undefined-function-socket_create() FAQ by clicking the link above. You may have https://community.apachefriends.org/f/viewtopic.php?f=16&t=3448 to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. Results 1 to 7 of 7 Thread: Fatal error: fatal error Call to undefined function: socket_create() Tweet Thread Tools Show Printable Version Email this Page… Subscribe to this Thread… Search Thread Advanced Search Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode 04-24-2004,05:49 AM #1 nesvarbu View Profile View Forum Posts Member Join Date Oct fatal error call 2003 Location Lithuania Posts 46 Fatal error: Call to undefined function: socket_create() Hi, Im using Mandrake Linux, and I have problems with php sockets. Here's my php code: PHP Code: $socket=socket_create(AF_INET,SOCK_STREAM,SOL_TCP);
I get an error: Fatal error: Call to undefined func
$connection=socket_connect($socket,'localhost',7016);
socket_write($socket,"
while($data=socket_read($socket,2046,PHP_NORMAL_READ))
{
echo$data;
}
?>
+ 1 hour Powered by Bitnami phpBB