PDA

View Full Version : PHP 5 Sockets Tutorial Error



phorte
October 4th, 2006, 03:42 AM
Hey there, was just testing out the new php 5 socket tutorial, and well am comin up with an error when i run the bat file. It comes up with

Fatal error: Call to undefined function socket_create() in E:\Server\www\pixelBox\misc\socket\socketTut.php on line 45

Dont understand why it would do that cause i tested the socket_create on its own, and that works, which leads me to believe its a syntax error somewhere else, like a missed ; on a line, thats what usually gives me that kind of error. But ive looked through it all and it looks all fine, so any ideas?? Btw im using the code that was in zip file that was in the tutorial.

-Phorte

yannick_
October 5th, 2006, 10:51 AM
Hey i used to have to same error. Try this it worked with me:

open your php.ini at c:/windows

1st thing to do:

look for this line:

;extension=php_sockets.dll

delete the ; in front of it.

2nd thing to do: look for this line:

; Directory in which the loadable extensions (modules) reside.
extension_dir = "./"

change it to where the "ext" directory is on your harddisk
for example:
extension_dir = "c:/web/php/ext";

That shall do..

yannick_
October 5th, 2006, 11:52 AM
Can anyone help me or explain this problem:

If i open this file: C:\web\Apache2\htdocs\socketsTut.html, the chat application works.

If i surf to http://localhost/socketsTut.html, the connection could not be established.

How can i fix this ?

And how can i make it work on my online webspace? This wasn't clear for me in the tutorial ..

Yannick

phorte
October 5th, 2006, 07:38 PM
Alrite, thanks i might try fiddling with that to get it to work.

As for not working on localhost, that makes no sense whatsoever.....

As for getting to work on your online hosting, you will have to talk to your hosting company to see if they have sockets working, and to get your sockets module running on their server, which i doubt they will do. But they may have their own socket thing running, youd just have to learn how to adapy your code to theirs

wohooo 500 posts! im soo slow.. thats like just over 100 a year....