[olug] PHP tcp devel

Sean Kelly smkelly at zombie.org
Tue Jan 13 23:26:01 UTC 2004


Resend. Evil list software won't allow my PGP signature :(

On Tue, Jan 13, 2004 at 11:01:48AM -0600, Ryan O'Rourke wrote:
> Is anyone out there doing any TCP level development with PHP? I'm not a
> developer, but the developer here is trying to tell me we need to
> upgrade to PHP 4.3 to support socket streams. He's trying to read a data
> stream from a TCP connection (credit auth stuff).
> I'm using RH AS 2.1 with PHP 4.1 (the newest available PHP RPM package
> for this platform) and have a hard time believing we're the first
> business to attempt this. I simply don't believe that all the businesses
> out there using RH AS 2.1 can't use PHP to read data from a TCP socket.
> 
> Help?

There are issues with sockety-related functions in older versions of
PHP. We ran across those on a project that used the f*() functions such as
fputs() and fread(). We ended up having to switch to the socket_*() family
of functions. With the f*() functions, we were experiencing unexplained
data loss. Some data that was sent to us would never be received, and some
data we transmitted would be lost. The socket_*() functions didn't have
this problem. I would advise running the newest stable version of PHP if you
are using sockets, as they seem to work properly and as expected now. I don't
remember what version we were having issues with, but I'm pretty sure it was
somewhere around 4.1.

-- 
Sean Kelly         | PGP KeyID: D2E5E296
smkelly at zombie.org | http://www.zombie.org


More information about the OLUG mailing list