How to resolve require_once with Unexpected T_STATIC error in PHP?

Asked

Viewed 57 times

0

I’m using the library https://github.com/nfe/client-php from Nfe.io to issue tax note automatically when the return of Paypal and Paypal is "Paid".

Try using the call in various ways, according to the documentation:

With Composer:

require_once('vendor/autoload.php');

Without Composer, downloading the library:

require_once ('client-php/lib/init.php');

And variations of them as:

require( dirname(__FILE__) . '/client-php/lib/init.php');

But always returns me the error of "Unexpected T_STATIC", as shown below:

 <b>Parse error</b>:  syntax error, unexpected T_STATIC in <b>/home/storage/a/f7/10/vovocooks/public_html/temp/client-php/lib/NFe/APIResource.php</b> on line <b>79</b><br />

Which is already in the library. I started using yesterday, but today (Saturday) no one should work in the Nfe.io company and I need this help.

  • 1

    What is the content of this line of code? And what version of PHP is running?

  • @Andersoncarloswoss the PHP Version: 5.2 and the line is require_once ('client-php/lib/init.php');

  • 1

    The only requirement of the library, see repository, is version 5.4 or higher of PHP. Update your PHP, then.

  • Yeah, now I’ve updated PHP and the error is in the $Curl = curl_init($url); returning Fatal error</b>: Call to Undefined Function curl_init() in

  • 1

    Ramos, you need to configure your PHP.ini to release the CURL library in your PHP, either: https://stackoverflow.com/a/6382581/6510304

  • 2

    Do you have the Curl extension installed? It is part of the library dependencies. You even read the archive README at least?

Show 1 more comment
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.