# Uncaught Error: Class "Auth0\\SDK\\..." not found

**URL:** <https://community.auth0.com/t/uncaught-error-class-auth0-sdk-not-found/85962>\
**Category:** Get Help\
**Tags:** auth0-php, php\
**Created:** [June 27, 2022, 6:51am UTC](https://community.auth0.com/t/uncaught-error-class-auth0-sdk-not-found/85962 "2022-06-27T06:51:16Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![matigo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/matigo/32/38404_2.png) [@matigo](https://community.auth0.com/u/matigo)\
**Post date:** [June 27, 2022, 6:51am UTC](https://community.auth0.com/t/uncaught-error-class-auth0-sdk-not-found/85962/1 "2022-06-27T06:51:16Z")

</div>

Hi,  
Based on the instructions below, I am trying to add login to my PHP application using the Auth0 PHP-SDK:

> **[Auth0 PHP SDK Quickstarts: Add Login to your PHP application](https://auth0.com/docs/quickstart/webapp/php/interactive)**
>
> Auth0 allows you to add authentication to your PHP application quickly and to gain access to user profile information. This guide demonstrates how to integrate Auth0 with any new or existing PHP application using the Auth0 PHP SDK.

Despite trying endless methods and different examples found on web, I’m still getting the error -  
“Fatal error: Uncaught Error: Class Auth0\SDK\Configuration\SdkConfiguration not found”  
I am wondering if it is related to some Apache or PHP settings of my Plesk installation, since it happens with any class, not just auth0. I’m using DigitalOcean VM, with Plesk installed.  
It would be greatly appreciated if you could help me. Unfortunately, I was not able to find a solution in the documentation.  
Thank you,  
Mati

---

<div class="post-metadata">

**Author:** ![evansims](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/evansims/32/27011_2.png) [@evansims](https://community.auth0.com/u/evansims)\
**Post date:** [June 27, 2022, 4:12pm UTC](https://community.auth0.com/t/uncaught-error-class-auth0-sdk-not-found/85962/2 "2022-06-27T16:12:41Z")

</div>

Hey @matigo 👋

It sounds like your PHP installation is failing the load the SDK files.

1. Can you confirm you have Composer accessible and installed the SDK using Composer?
2. Can you confirm your app is loading the Composer autoload.php file, from within the vendor subdirectory?
3. From a shell, can you run ‘composer show -I’ from your project directory root (where your composer.json and lock file are) and share the output here to help diagnose.

Thanks!

---

<div class="post-metadata">

**Author:** ![matigo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/matigo/32/38404_2.png) [@matigo](https://community.auth0.com/u/matigo)\
**Post date:** [June 27, 2022, 5:48pm UTC](https://community.auth0.com/t/uncaught-error-class-auth0-sdk-not-found/85962/3 "2022-06-27T17:48:14Z")

</div>

Hi @evansims ,

Please find below answers to your questions:

1. The current response to composer require auth0/auth0-php is attached -

```auto
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Continue as root/super user [yes]? yes
Info from https://repo.packagist.org: #StandWithUkraine
Using version ^7.9 for auth0/auth0-php
./composer.json has been updated
Running composer update auth0/auth0-php
Loading composer repositories with package information
Updating dependencies
Nothing to modify in lock file
Installing dependencies from lock file (including require-dev)
Nothing to install, update or remove
Generating autoload files10 packages you are using are looking for funding.

```

1. The current response to cat vendor/autoload.php -

```auto

<?php

// autoload.php @generated by Composer

if (PHP_VERSION_ID < 50600) {
    echo 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
    exit(1);
}

require_once __DIR__. '/composer/autoload_real.php';

return ComposerAutoloaderInit8edebcea30a518a9b07a52ecac828c00::getLoader();

```

1. The current response to composer show -l

```auto

Do not run Composer as root/super user! See https://getcomposer.org/root for details
Continue as root/super user [yes]? yes
Color legend:
- patch or minor release available - update recommended
- major release available - update possible
- up to date version
auth0/auth0-php 7.9.2 7.9.2 Auth0 PHP SDK.
auth0/php-jwt 3.3.4 3.2.5 A simple library to work with JSON Web Token and JSON Web Signature
guzzlehttp/guzzle 7.4.5 7.4.5 Guzzle is a PHP HTTP client library
guzzlehttp/promises 1.5.1 1.5.1 Guzzle promises library
guzzlehttp/psr7 1.9.0 2.4.0 PSR-7 message implementation that also provides common utility methods
nyholm/psr7 1.5.1 1.5.1 A fast PHP7 implementation of PSR-7
php-http/message-factory v1.0.2 v1.0.2 Factory interfaces for PSR-7 HTTP Message
psr/container 2.0.2 2.0.2 Common Container Interface (PHP FIG PSR-11)
psr/http-client 1.0.1 1.0.1 Common interface for HTTP clients
psr/http-factory 1.0.1 1.0.1 Common interfaces for PSR-7 HTTP message factories
psr/http-message 1.0.1 1.0.1 Common interface for HTTP messages
psr/log 3.0.0 3.0.0 Common interface for logging libraries
psr/simple-cache 1.0.1 3.0.0 Common interfaces for simple caching
ralouphie/getallheaders 3.0.3 3.0.3 A polyfill for getallheaders.
symfony/deprecation-contracts v3.1.0 v3.1.0 A generic function and convention to trigger deprecation notices
symfony/http-client v6.1.1 v6.1.2 Provides powerful methods to fetch HTTP resources synchronously or asynchronously
symfony/http-client-contracts v3.1.0 v3.1.0 Generic abstractions related to HTTP clients
symfony/polyfill-mbstring v1.26.0 v1.26.0 Symfony polyfill for the Mbstring extension
symfony/service-contracts v3.1.0 v3.1.0 Generic abstractions related to writing services

```

I appreciate your help once again, thank you,  
Mati

---

<div class="post-metadata">

**Author:** ![evansims](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/evansims/32/27011_2.png) [@evansims](https://community.auth0.com/u/evansims)\
**Post date:** [June 27, 2022, 6:12pm UTC](https://community.auth0.com/t/uncaught-error-class-auth0-sdk-not-found/85962/4 "2022-06-27T18:12:28Z")

</div>

Hey @matigo 👋 Thanks for the extra info. So, that explains the situation: you’re using the previous version of the PHP SDK, which our documentation doesn’t reference anymore. The class in question is new to V8 of the PHP SDK.

The fact that Composer installed this version of the SDK for you instead of the latest tells me your environment is running an older and unsupported version of PHP. Can you check what version of PHP is installed? Our supported PHP versions follow the official support lifecycle, which can be found here: [PHP: Supported Versions](https://www.php.net/supported-versions.php)

---

<div class="post-metadata">

**Author:** ![matigo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/matigo/32/38404_2.png) [@matigo](https://community.auth0.com/u/matigo)\
**Post date:** [June 27, 2022, 6:30pm UTC](https://community.auth0.com/t/uncaught-error-class-auth0-sdk-not-found/85962/5 "2022-06-27T18:30:37Z")

</div>

Looks like I’m using PHP 8.1.7.  
Anyway, is is possible to manually enforce the installation/using of the latest version of the  
Sdk?  
Thank you,  
Mati

---

<div class="post-metadata">

**Author:** ![evansims](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/evansims/32/27011_2.png) [@evansims](https://community.auth0.com/u/evansims)\
**Post date:** [June 27, 2022, 6:47pm UTC](https://community.auth0.com/t/uncaught-error-class-auth0-sdk-not-found/85962/6 "2022-06-27T18:47:51Z")

</div>

Unusual! Was this a fresh installation of the SDK, or are you migrating a project of some kind? I’m not certain why Composer would have delivered SDK V7 on a new project with PHP 8.1, that doesn’t make sense. You might run `php -v` from your shell just in case, perhaps, your environment is mistakenly invoking an outdated version of the PHP somewhere on the host. (Most likely Pesk upgraded your PHP runtime after the Composer install occurred, but it’s impossible to say.)

In any case, try running `composer require auth0/auth0-php "^8.0"`. As a last resort, you can try manually setting the version in your `composer.json` file to `^8.0` and running `composer install` again.

---

<div class="post-metadata">

**Author:** ![matigo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/matigo/32/38404_2.png) [@matigo](https://community.auth0.com/u/matigo)\
**Post date:** [June 28, 2022, 8:25am UTC](https://community.auth0.com/t/uncaught-error-class-auth0-sdk-not-found/85962/7 "2022-06-28T08:25:37Z")

</div>

Thanks a lot. It finally worked when I required the 8.0 version.

I’ll use this thread for another question:

I have integrated Auth0 login into my MediaWiki at [https://wiki](https://wiki).[mydomain]/. It works perfectly.

I have another subdomain (let’s call it [https://site](https://site).[mydomain]/) that contains a simple php website. My application used in wiki’s subdomain has that subdomain added to its cross origin settings.

Now I just want to add simple session check to the other sub-domain - if the user is already logged in, he can continue to site.mydomain - otherwise he will be redirected to authentication login (I’m using Auth0’s login form, not mine)

I have tried many code examples, but I am unable to make it work. Can you give me an example of code for this scenario in a production environment (not a local environment)?

Thank you,

Mati

---

<div class="post-metadata">

**Author:** ![evansims](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/evansims/32/27011_2.png) [@evansims](https://community.auth0.com/u/evansims)\
**Post date:** [June 28, 2022, 4:38pm UTC](https://community.auth0.com/t/uncaught-error-class-auth0-sdk-not-found/85962/8 "2022-06-28T16:38:52Z")

</div>

Glad you got it sorted!

As to your other question: Assuming both apps are using the same configuration, and you have configured the ‘cookieDomain’ to “.mydomain.whatever” (so the session cookie is accessible to all subdomains) you shouldn’t need to do any particularly special coding; it should just work.

The only practical issue I foresee there is both apps need to use the same Auth0 Application details, which means the redirect url will need to point to a specific url on one of those apps to handle the call back.

To check if a session is available you can just use the ‘getCredentials()’ method from the SDK.

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [July 28, 2022, 10:30am UTC](https://community.auth0.com/t/uncaught-error-class-auth0-sdk-not-found/85962/9 "2022-07-28T10:30:29Z")

</div>


