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 ...

Get Learning Apache Thrift now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.