Today's Question:  What does your personal desk look like?        GIVE A SHOUT

socket_create() from command prompt with WAMP

  ABRAHAM        2011-05-30 10:59:14       6,386        0    

Problem:

I’m working on a wamp system, and have started playing around with sockets. I enabled sockets via the wamp interface:
wamp : PHP settings : PHP extensions : php_sockets
and could run my php file via my browser.

When trying to run the same file via the command prompt (start : run : cmd), I got the following error:

Fatal error: Call to undefined function socket_create() in … on line …


Solution:

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 is 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.


Source : http://anvilstudios.co.za/blog/php/call-to-undefined-function-socket_create-from-command-prompt/

PHP  WAMP  WINDOWS  COMMAND LINE  SOCKET 

Share on Facebook  Share on Twitter  Share on Weibo  Share on Reddit 

  RELATED


  0 COMMENT


No comment for this article.