PDA

View Full Version : PHP Socket Server Tutorial, Help!



grimm 88
September 13th, 2008, 10:43 AM
Hi... this is my first post in these forums so please be nice! XD

anyway, i followed a tutorial by Raymond aka ObiAdmin HERE: http://www.kirupa.com/developer/flash8/php5sockets_flash8.htm

now i managed to install apache, php and get the socket server to run through command prompt, but whenever i try to access it with flash it fails for some reason!

the strange thing is that when i export (ctrl+enter) my flash movie INSIDE the actual flash program it can either connect or say that it hasn't connected (depending on wether i am running the socketShell.php via command prompt) but whenever i open it any other way such as by double clicking the .swf or going to localhost/flash.html it ALWAYS fails no matter what i do and even if i am running the socket shell!

anyway, i was just wondering if anybody else had this problem and if they had any idea how to fix it?

also, here is some more information:

my apache httpd.conf file if listening on 192.168.1.70:80 (my LAN ip address, and i checked that it was right) and the servername is the same... i am also port forwarding (ports 80 and 1234 [i am running socket server on 1234]) so that people from outside can view my files, and it works, but they also see the 'could not connect' error...

inside my flash i have tried everything... changing the thing to connect to from localhost to 192.168.1.70 (internal LAN ip), my external ip, my no-ip redirection site name, 127.0.0.1 and NOTHING works! but i only get the connection inside the flash preview window when it is set to localhost or 127.0.0.1

anyway, sorry for the wall of text, hope somebody can help me!

grimm 88
September 14th, 2008, 03:05 PM
please! i really need an answer to this soon!

EDIT: ok, ive managed to get the local running working so i can run it by opening the swf from inside my htdocs while running the shell server, but people from outside still cannot access it!

EDIT2: yeah, turned out it was a problem with a <policy-file-request> and i basically forwarded ports 843 (default policy file request port) and 1234 (my socket server port) on my router and added a little 'allow all' policy file and it worked a beaut! so if anybody else is having problems with this i suggest reading the adobe help about flash player 9 and policy file requests, and they even have some sample policy file request code that you can use to allow all connections like i did