Is it possible to use Auth0 PHP SDK with PHP 5.4?

Hi there,

I’m fairly new to Auth0 and OAuth.

I have a traditional web app currently using PHP 5.4 and are planning to use Auth0 PHP SDK for my app.
I have a few questions about the Auth0 PHP SDK and would like some answers:

  1. What is the minimum version of the Auth0 PHP SDK supported?
  2. As far as I know, the latest version of the Auth0 PHP SDK requires a minimum PHP version of 7.4. But is it possible to use this SDK with PHP 5.4?
  3. If I upgrade the PHP version, what version should I upgrade to?

Any help is greatly appreciated!
Thank you!

Hi @zix_dl :wave: Unfortunately we do support PHP versions after they leave the PHP Group’s support lifecycle. We currently support the PHP versions listed on that page, or alternatively you can reference our README’s support matrix.

  1. What is the minimum version of the Auth0 PHP SDK supported?

PHP 7.4 at this time, although support for PHP 7 is ending this November.

  1. As far as I know, the latest version of the Auth0 PHP SDK requires a minimum PHP version of 7.4. But is it possible to use this SDK with PHP 5.4?

I’m afraid that’s not possible, the SDK makes use of newer language features in the PHP runtimes. Attempting to run the SDK under PHP 5.4 will throw language errors.

  1. If I upgrade the PHP version, what version should I upgrade to?

PHP 8.0+. Ideally, it’s always best to upgrade to the latest version (which would be 8.1 at this time.)

You might find these helpful in your upgrade process:
https://www.php.net/manual/en/migration56.php
https://www.php.net/manual/en/migration70.php
https://www.php.net/manual/en/migration80.php
https://www.php.net/manual/en/migration81.php

Also, I’d strong encourage you to look at using Rector, which is a great tool for automatically refactoring PHP code to support upgrading runtimes.

1 Like