PDA

View Full Version : Need help creating a php socket server



solemn wishes
04-09-2009, 06:39 PM
Hello,

Please have a little patience with me while im explaining this -

I was using a method of sending data to a php script and the data was written to a file and saved on the server. The data is being sent via a SCAR client. It bassicly did this in scar -



AddPostVariable(HTTP1, 'VarName' , 'var' );

SendCords:= PostHTTPPageex(HTTP1, 'website');


So scar send the variables and the php script writes them to a .txt file on the web server

This works fine but the speed is immensly slow, ive been reading up and it seems that my best option would be to create a php socket server for a greater speed?

Now this is not my area of expertise but could anyone give me a helping hand, or show me the way that i should be approaching this?

If you need any more details (I've been a little blunt i know) please ask!

Any help is appreicated,

Wizzup?
04-09-2009, 09:09 PM
You should not make a server with PHP... It makes no sense.

What you want is a C or Java (sigh) server, which accepts incoming connections. That program will use a database, MySQL or PostGreSQL to store and retrieve it's data.

Making it in PHP simply won't work. PHP isn't made for that... It is made for generating HTML and such, or performing small tasks once a website is loaded.
If you want me to explain some more on server applications, sockets and PHP, feel free to ask. :)

BKNYKavkaz
04-28-2009, 05:24 AM
You should not make a server with PHP... It makes no sense.

What you want is a C or Java (sigh) server, which accepts incoming connections. That program will use a database, MySQL or PostGreSQL to store and retrieve it's data.

Making it in PHP simply won't work. PHP isn't made for that... It is made for generating HTML and such, or performing small tasks once a website is loaded.
If you want me to explain some more on server applications, sockets and PHP, feel free to ask. :)

I dont believe Java should be used here. c, c# or c++.

Wizzup?
04-28-2009, 06:07 PM
I dont believe Java should be used here. c, c# or c++.

Well, in theory it is even possible with PHP. But I think that if Solemn doesn't know much C, sockets and threads can and WILL be a pain. :)