Closed amauryleproux closed 6 years ago
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 ;-) .
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
@amauryleproux Is it the complete error message? Don't you have a longer error stacktrace?
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:
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:
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.
You rock! Thanks again :)
@amauryleproux You're welcome :)
Thank you @AlexMiroshnikov @amauryleproux I have updated examples: https://github.com/postaddictme/instagram-php-scraper/tree/master/examples
Guys does anyone has an idea why I get this error when I try to get Media by location id please?
Thanks