Skip to content

Undefined constant "PhpMcp\Server\Transports\SIGTERM" #44

@holtkamp

Description

@holtkamp

I noticed some errors in our logs:

 Failed to start listening or event loop crashed. {"exception":"Error: Undefined constant \"PhpMcp\\Server\\Transports\\SIGTERM\" in /app/vendor/php-mcp/server/src/Transports/StdioServerTransport.php:153

Stack trace:
#0 /app/vendor/php-mcp/server/src/Server.php(153): PhpMcp\\Server\\Transports\\StdioServerTransport->listen()
#1 /app/packages/my-model-context-protocol/php/php-mcp-server.php(37): PhpMcp\\Server\\Server->listen()
#2 {main}

Which led me to https://stackoverflow.com/questions/42575136/use-of-undefined-constant-sigterm-assumed-sigterm/42575881

Apparently the PCNTL extension is required. Maybe "ext-pcntl": "*", should be added to the require-section of composer.json?

For example on Heroku, the use of ext-pcntl must be explicitly indicated: https://devcenter.heroku.com/articles/php-support

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions