Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP Strict Standards: Non-static method InstagramScraper\Instagram::getLocationById() should not be called statically #185

Closed
amauryleproux opened this issue Oct 21, 2017 · 8 comments

Comments

@amauryleproux
Copy link

Guys does anyone has an idea why I get this error when I try to get Media by location id please?

Thanks

@AlexMiroshnikov
Copy link

You get this error because getLocationById() is not a static method, so it must be applied to an instance of Instagram class. Instead of Instagram::getLocationById() use the following:

$ig = Instagram::withCredentials(...);
$ig->getLocationById(...);

Btw, this is also quite obvious ;-) .

@amauryleproux
Copy link
Author

I really start to love you haha thanks again but this time I found it before you replied :p but it's not working anyway :/

I got this :
PHP Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct():
It is not safe to rely on the system's timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone.' in /Applications/MAMP/htdocs/instagram-php-scraper/vendor/phpfastcache/phpfastcache/src/phpFastCache/Drivers/Files/Item.php:39

@AlexMiroshnikov
Copy link

@amauryleproux Is it the complete error message? Don't you have a longer error stacktrace?

@amauryleproux
Copy link
Author

There is the whole message:

PHP Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): It is not safe to rely on the system's timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone.' in /Applications/MAMP/htdocs/instagram-php-scraper/vendor/phpfastcache/phpfastcache/src/phpFastCache/Drivers/Files/Item.php:39
Stack trace:
#0 /Applications/MAMP/htdocs/instagram-php-scraper/vendor/phpfastcache/phpfastcache/src/phpFastCache/Drivers/Files/Item.php(39): DateTime->__construct()
#1 [internal function]: phpFastCache\Drivers\Files\Item->__construct(Object(phpFastCache\Drivers\Files\Driver), 'amauryleproux')
#2 /Applications/MAMP/htdocs/instagram-php-scraper/vendor/phpfastcache/phpfastcache/src/phpFastCache/Core/StandardPsr6StructureTrait.php(56): Reflection in /Applications/MAMP/htdocs/instagram-php-scraper/vendor/phpfastcache/phpfastcache/src/phpFastCache/Drivers/Files/Item.php on line 39

Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): It is not safe to rely on the system's timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone.' in /Applications/MAMP/htdocs/instagram-php-scraper/vendor/phpfastcache/phpfastcache/src/phpFastCache/Drivers/Files/Item.php:39
Stack trace:
#0 /Applications/MAMP/htdocs/instagram-php-scraper/vendor/phpfastcache/phpfastcache/src/phpFastCache/Drivers/Files/Item.php(39): DateTime->__construct()
#1 [internal function]: phpFastCache\Drivers\Files\Item->__construct(Object(phpFastCache\Drivers\Files\Driver), 'amauryleproux')

@AlexMiroshnikov
Copy link

Try to either to add a default timezone to you php ini file or set it in your script via date_default_timezone_set() command.

@amauryleproux
Copy link
Author

You rock! Thanks again :)

@AlexMiroshnikov
Copy link

@amauryleproux You're welcome :)

@raiym raiym closed this as completed Nov 6, 2017
@raiym
Copy link
Member

raiym commented Nov 6, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants