O'Reilly logo

Learning Apache Thrift by Krzysztof Rakowski

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Running the code

Now is the time to run the scripts and see the outcome. It is best to use two separate terminal windows so that you can observe the result of the operation on both client and server side.

To start your PHP service, you need to run it through the Python wrapper that you wrote. To do this, run the following command:

$ python runserver.py
Starting server on port 8080...

If you see a message like this and no other error, it means that your PHP service is listening on the port 8080 on your computer. In this window, you will see information about all the incoming connections and their results.

Now, let's try to call our service with Python client script. To do this, run the following command:

$ python client.py

If everything happened ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required