Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8223105
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T14:33:27+00:00 2026-06-07T14:33:27+00:00

I have set up Thrift on my local system – windows 7 , PHP

  • 0

I have set up Thrift on my local system – windows 7 , PHP 5.3.8, Apache 2.2.21, Thrift 0.80,APC .
I have tried to run the Client/Server thrift programs generated from Thrift compiler however none of the programs work. Each one gives me an error ‘TSocket: Could not read 4 bytes from “localhost/path_to_client port 80” ‘.

I have enabled Socket extensions for PHP and tried using THttpClient and TSocket classes but none of these are working.
I have switched Protocol classes from TBinaryProtocol to TBinaryProtocolAccelerated with no results.

I have gone through core classes of Thrift and I see that ‘_handle’ actually doesn’t points to a file rather it points to ‘localhost’. I have tried giving it a file path but it still doesn’t works.

I don’t have much experience in Socket programming, however I feel that I am doing most of things correctly.

Your help on the same will be highly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T14:33:29+00:00Added an answer on June 7, 2026 at 2:33 pm

    I was able to resolve this issue and here is how -:

    1. First and foremost the syntax to generate PHP code from Thrift compiler is thrift –gen php*:server* yourfile.thrift . I was missing :server from the code. This wasn’t mentioned in Thrift documentation

    2. Include the generated PHP file from Thrift compiler in your client and server file .

    3. Your server file should implement the Thrift interface.

    4. Make sure you start your Thrift server by executing the server file first. Make an object of yourclassProcessor file and open the transport layer. You will find this in thrift php tutorial.

    5. Call the server functions from your client file as given in examples.

    Note- Make sure that you understand the functions return types well enough in Thrift.

    Regards
    Kunal

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have set up subclipse and my svn server to run over ssh. Everything
I have managed to set up Cassandra + Thrift and the Python wrapper for
I have set up upload_max_filesize and post_max_size to 32Mb in php.ini. I am using
I have a client / server setup for Cassandra that works when accessed via
I have set up a LAMP server on aws. I am planning to create
I have set up VisualSvn Server, created a repository and added Visual Studio solution
I have set up an ISPconfig server and am now trying to install curl.
I have set up a connection with a rather large https server and I
I have set up 2 apache servers, one for 80 port and second for
I have set up a openVPN tunnel using the following server side configuration: port

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.