I was Windows command Line Input command:C:\wamp\bin\php\php5.2.6\php.exe getxml.php to execute PHP files.
error occurred: Fatal error:call to undefined function socket_create () in C:\wamp\www\getXml.php on line
online search on a lot of forums on the q&a posts , the answer is basically:
1. find php.ini, see extension=php_sockets.dll If the extension is open, the previous comment ; delete.
2. see phpinfo () display content, Socket is the module enable;
and there's a little bit less. dll files, but php4ts.dll,php5ts.dll,php_mime_magic.dll and copy them to the directory C:/windows/system32 , and confirm that there are php_sockets.dll in the ext folder under the PHP directory. file, the result still does not solve the problem.
Solution: This is a program seen in an English forum, which has proven to be feasible.
The original text is:
The command prompt uses a different php.ini file to the Apache server.
The Apache php.ini file is accessible via the taskbar icon, and are located at:
X:\WAMP INSTALL Dir\apache2\bin\php.ini
The command prompt php.ini file is located at:
X:\WAMP INSTALL Dir\php\php.ini
Once I ' d enabled sockets in this file, by uncommenting the line:
Extension=php_sockets.dll
and restarted the server, everything worked great.
Available in two directories php.ini We use the wamp management interface to directly modify the php.ini is located at:
C:\wamp\bin\apache\apache2.2.8\bin\php.ini (different from the personal installation directory), it turns out that I did change this in the php.ini file. Php_sockets.dll in front of the annotation symbol ";" , But why doesn't it work?
that's because in a different directory : the extension in C:\wamp\bin\php\php5.2.6\php.ini (also different from personal installation) has not been modified , and we just need to modify it, it's OK, and a copy of the revised Php,ini The file to the directory C:\Windows\ directory.
PHP Open Socket Configuration