Repository navigation
THRIFT-6498: Fix the PHP tutorial server and its runserver.py - #4158
Open
slachiewicz wants to merge 1 commit into
Open
slachiewicz wants to merge 1 commit into
slachiewicz wants to merge 1 commit into
Conversation
Client: php Since THRIFT-6004 the generated CalculatorIf and SharedServiceIf carry native types, so the untyped handler in PhpServer.php was a fatal error. The handler now uses the generated signatures. The header() call lacked the colon, which php -S sent as a malformed header line, so THttpClient failed to read replies. runserver.py was Python 2 only (and CGIHTTPRequestHandler is deprecated); it now starts php -S on port 8080, which needs no shebang line in PhpServer.php. Makefile.am depended on gen-php/tutorial/Calculator.php, which is no longer generated; it now uses CalculatorIf.php. Tested: generated the tutorial code, ran runserver.py and PhpClient.php --http. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
4 tasks done
slachiewicz
marked this pull request as ready for review
November 8, 2026 20:16
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Jira: THRIFT-6498
The PHP tutorial server no longer loaded: since THRIFT-6004 the generated
CalculatorIfandSharedServiceIfdeclare native types, so the untyped handler inPhpServer.phpis a fatal error. The handler now uses the generated signatures. Itsheader()call also lacked the colon, whichphp -Ssent as a malformed header line, soTHttpClientcould not read the replies.runserver.pywas Python 2 only (BaseHTTPServer, and the CGI handler is removed in Python 3.15). It now startsphp -Son port 8080, and the server's header comment says so.Makefile.amdepended ongen-php/tutorial/Calculator.php, which is no longer generated; it now usesCalculatorIf.php.Verified: on master
php PhpServer.phpfails with "Declaration of CalculatorHandler::ping() must be compatible with CalculatorIf::ping(): void"; on this branch, afterthrift --gen php:server -r ../tutorial.thrift,python3 runserver.pyandphp PhpClient.php --httpprint ping, 1+1=2, the divide-by-zero InvalidOperation, 15-10=5 and the getStruct log.