PHP Open Socket Configuration

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.