Connecting go with php

841 views
Skip to first unread message

Slawomir Pryczek

unread,
Apr 27, 2016, 1:15:25 PM4/27/16
to golang-nuts
Hi Guys, we have written a tool in our company that allows fast communication between golang and PHP. It's golang socket server, and php persistent sockets client. Main reason for writing it was that some algorithms in PHP are like 1000-10k times slower than in go, and writing a short module is much easier to do than writing PHP extension, so it could speed up PHP code a lot.

Main reason for doing socket server is that's much faster than HTTP calls. We're thinking about open-sourcing it, anyone would be interested?

John Souvestre

unread,
Apr 27, 2016, 2:00:07 PM4/27/16
to golan...@googlegroups.com

Yes!  I have a friend who uses PHP but is interested in Go.  Being able to mix them would make his transition easier.

 

John

    John Souvestre - New Orleans LA

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Konstantin Khomoutov

unread,
Apr 28, 2016, 12:01:59 PM4/28/16
to Slawomir Pryczek, golang-nuts
Can you elaborate on what exactly do you mean by "socket server"?
I'm confused because most of the time HTTP is done over sockets
(usually TCP socket but Unix-domain sockets are not too uncommon),
so when you contrast HTTP and sockets it sounds like apples to oranges
to me.

Do you mean you have implmented some soft of binary protocol (may be
RPC-like) over sockets?

Slawomir Pryczek

unread,
Apr 28, 2016, 1:24:42 PM4/28/16
to golang-nuts
@John: that's great, will post a link to repo and some docs soon... i think next week should be ready.

@Konstantin: Yes that's RPC-like binary protocol and server that allows you to expose golang methods via tcp / udp sockets, and call them from websites, php app, etc. So in 5-10 minutes you can setup a system to port your cpu-intensitive code from php, perl, python, etc. to golang. So it's not just RPC, but full server.

Slawomir Pryczek

unread,
May 1, 2016, 12:56:56 PM5/1/16
to golang-nuts
Hi Guys,
today the project went live, i invite everyone to contribute & use it... There is PHP client, Golang RPC-like server, and some examples how to communicate.


And here you have server-status screen
Reply all
Reply to author
Forward
0 new messages