Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Pro PHP
|
Pro PHP Advanced PHP coding discussions. Beginning-level questions will be redirected to the Beginning PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 15th, 2004, 01:25 PM
Authorized User
 
Join Date: Jun 2003
Posts: 97
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to planeswalk
Default error on socket_create

Hi,

I have the following system installed:

PHP 4.3.9
Windows 2000 Server - IIS 5.0

Basically my problem is when I try to call the socket_create() function in a script, I get the following error:

Fatal error: Call to undefined function: socket_create()

Any ideas?

Thanks in advance,
Marlon



Marlon Villarama
 
Old October 15th, 2004, 02:32 PM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

You need to enable the entension in php.ini.

First, uncomment the reference to the .dll.

Code:
;extension=php_pgsql.dll
;extension=php_shmop.dll
;extension=php_snmp.dll
extension=php_sockets.dll
;extension=php_sybase_ct.dll
;extension=php_tidy.dll
;extension=php_w32api.dll
;extension=php_xmlrpc.dll
Then make sure that the extension dll exists in the extension directory, which is set via the extension_dir directive.

Code:
; Directory in which the loadable extensions (modules) reside.
extension_dir = "./"
Restart your HTTP server after ini modifications, and the function should work.

(Most common PHP extensions are shipped in the .zip download of PHP)

HTH!

Regards,
Rich

--
[http://www.smilingsouls.net]
[http://pear.php.net/Mail_IMAP] A PHP/C-Client/PEAR solution for webmail
 
Old October 15th, 2004, 02:56 PM
Authorized User
 
Join Date: Jun 2003
Posts: 97
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to planeswalk
Default

Thanks for the prompt answer!

Unfortunately it gave me another error :(

Now I see an "HTTP 400 - Bad Request" error when I try to run the code, and I get prompted with the error:

Unable to load the module 'c:\php\extensions\php_sockets.dll'

even if the dll is already in that folder. Any ideas?

Thanks!
Marlon





Marlon Villarama
 
Old October 20th, 2004, 12:13 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 836
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Make sure your extension_dir is set properly. If all else fails, you can either add PHP's extension dir to your system path, or copy/move the extension dll to a directory in the system path (e.g. c:\winnt\system32)


Take care,

Nik
http://www.bigaction.org/





Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert Query Error & Run-Time Error 3022 DavidWE Access 1 July 31st, 2008 11:17 AM
Ch 4: Parse error: syntax error, unexpected T_SL hanizar77 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 0 June 23rd, 2008 09:17 PM
Parse error: syntax error, unexpected T_STRING ginost7 Beginning PHP 1 November 9th, 2007 02:51 AM
VB Error: Syntax Error or Access Violation codehappy VB How-To 7 October 3rd, 2007 05:41 PM
Phile Page error, visual studio error reps BOOK: ASP.NET Website Programming Problem-Design-Solution 0 September 27th, 2003 10:11 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.