Skip to content

HelloWorld-PHP php7.4 error #13

@Code-creators-dev-team-iqmerchant

Description

The below mentioned code works in php8.0

https://github.com/IntuitDeveloper/HelloWorld-PHP

With php7.4, it shows error

Notice: session_start(): A session had already been started - ignoring in /var/www/wordpress/qb-oauth/index.php on line 14

Fatal error: main(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "QuickBooksOnline\API\Core\OAuth\OAuth2\OAuth2AccessToken" of the object you are trying to operate on was loaded before unserialize() gets called or provide an autoloader to load the class definition in /var/www/wordpress/qb-oauth/index.php on line 37

which corresponds to these functions

'access_token' => $accessToken->getAccessToken(),
'refresh_token' => $accessToken->getRefreshToken(),
'x_refresh_token_expires_in' => $accessToken->getRefreshTokenExpiresAt(),
'expires_in' => $accessToken->getAccessTokenExpiresAt()

(Same folder code with hosted with PHP 8.0 localhost , it works, but with same folder and php7.4, we get above FATAL error)

Workaround: Use php8.0, remove php7.4

URL for testing

https://96-2-10-19-dynamic.midco.net/qb-oauth/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions