PSR-17 Fatal Error

Hi,

I’m building my first Auth0 app. It’s running fine locally, but when I moved to my production server I get a fatal error:

Fatal error: Uncaught InvalidArgumentException: Could not find a PSR-17 compatible request factory. Please install one, or provide one using the setHttpRequestFactory() method.

I’ve got the exact same setup locally and remote, my composer.json looks like this:

{
    "require": {
        "symfony/http-client": "^7.2",
        "nyholm/psr7": "^1.8",
        "auth0/auth0-php": "^8.13",
        "steampixel/simple-php-router": "^0.7.1",
        "guzzlehttp/guzzle": "^7.9",
        "guzzlehttp/psr7": "^2.7",
        "http-interop/http-factory-guzzle": "^1.2"
    },
    "config": {
        "allow-plugins": {
            "php-http/discovery": false
        }
    }
}

I’ve tried setting the request factory explicitly like this, but it doesn’t work either:

$auth0 = new Auth0([
    'domain' => 'YOUR_AUTH0_DOMAIN',
    'client_id' => 'YOUR_CLIENT_ID',
    'client_secret' => 'YOUR_CLIENT_SECRET',
    'redirect_uri' => 'YOUR_REDIRECT_URI',
    'request_factory' => $psr17Factory, // Pass the factory here
]);

Anyone got any tips on how to troubleshoot this?

Thanks.

Oops. I re-built my composer packages and it solved the problem. Must’ve had a conflict somewhere.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.