# Auto not working after update my php version from 5.x to 8.x

**URL:** <https://community.auth0.com/t/auto-not-working-after-update-my-php-version-from-5-x-to-8-x/196405>\
**Category:** Get Help\
**Tags:** login-experience, new-universal-login-experience\
**Created:** [January 20, 2026, 12:13pm UTC](https://community.auth0.com/t/auto-not-working-after-update-my-php-version-from-5-x-to-8-x/196405 "2026-01-20T12:13:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![impala.bhavesh](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/impala.bhavesh/32/71119_2.png) [@impala.bhavesh](https://community.auth0.com/u/impala.bhavesh)\
**Post date:** [January 20, 2026, 12:13pm UTC](https://community.auth0.com/t/auto-not-working-after-update-my-php-version-from-5-x-to-8-x/196405/1 "2026-01-20T12:13:14Z")

</div>

Hi,

I was using Auth0 with an older PHP version (5.x), and now I’ve updated PHP to version 8.x. After logging in, `$auth0->getUser()` always returns blank, and I’m not getting any user information.

I also changed the `audience` from a string to an array. I am currently testing this on localhost.

---

<div class="post-metadata">

**Author:** ![gerald.czifra](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gerald.czifra/32/75301_2.png) [@gerald.czifra](https://community.auth0.com/u/gerald.czifra)\
**Post date:** [January 20, 2026, 10:15pm UTC](https://community.auth0.com/t/auto-not-working-after-update-my-php-version-from-5-x-to-8-x/196405/3 "2026-01-20T22:15:15Z")

</div>

Hi @impala.bhavesh

Welcome to the Auth0 Community!

The upgrade that you have undergone is a big jump and introduces specific ways of handling authentication. The behaviour that you are see can have a number of causes, one of the most likely culprits can be:

- the `openid` scope could be missing, which in turn would cause an ID Token to not be returned and the user would no be read correctly or at all;
- as you are testing with `localhost`, please make sure that [cookieSecure](https://github.com/auth0/auth0-PHP/blob/main/UPGRADE.md#:~:text=on%20the%20domain.%0A%24-,cookieSecure,-bool%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Defaults%20to) is set to false, that way a non-HTTPS connection would be accounted for;
- ensure that the callback logic includes `exchange()`in order to populate user data, more information can be found in our [PHP documentation](https://auth0.com/docs/quickstart/webapp/php#handling-authentication-callback:~:text=the%20HTTP%20request.-,The%20Auth0%20PHP%20SDK%E2%80%99s,-exchange()%20method);
- just to be sure this is mentioned, please also verify that [clientSecret](https://auth0.com/docs/quickstart/webapp/php#handling-authentication-callback:~:text=require%20vlucas/phpdotenv-,Next%2C%20let%E2%80%99s%20create,-the%20PHP%20source) is added to the code.

Hope this helped clear the issue, but let us know if it’s still ongoing for you!

Best regards,  
Gerald

---

<div class="post-metadata">

**Author:** ![impala.bhavesh](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/impala.bhavesh/32/71119_2.png) [@impala.bhavesh](https://community.auth0.com/u/impala.bhavesh)\
**Post date:** [February 3, 2026, 9:14am UTC](https://community.auth0.com/t/auto-not-working-after-update-my-php-version-from-5-x-to-8-x/196405/4 "2026-02-03T09:14:12Z")

</div>

It is not working here is my code

$application = Application::getApplication();

```auto
$auth0_config = $application->getApplicationConfiguration('auth0_config');
$auth0_config['redirect_uri'] = Utility::createAbsoluteURL('/member.php?task=logon');
$auth0_config += [
    'audience' => ['urn:test:api'],
    'persist_id_token' => true,
    'persist_refresh_token' => true,
    'cookie_secure' => false,
    'cookie_samesite' => 'Lax',
];

self::$auth0 = new Auth0($auth0_config);

// Only try to get user AFTER redirect with code
$userInfo = null;

if (!empty($_GET['code'])) {
	try {
		// Exchange the code for tokens
		$userInfo = self::$auth0->exchange();  
		
		// Persist tokens in session
		self::$auth0->persist($userInfo);  
		
		// Now get the user info from session
		$userInfo = self::$auth0->getUser();
	} catch (\Exception $e) {
		echo "Auth0 getUser error: " . $e->getMessage();
		die;
	}
}

```

it show error Auth0 getUser error: Invalid state

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [February 17, 2026, 9:15am UTC](https://community.auth0.com/t/auto-not-working-after-update-my-php-version-from-5-x-to-8-x/196405/5 "2026-02-17T09:15:08Z")

</div>

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