I have installed Instagram-PHP library https://github.com/mgp25/Instagram-API via
composer require mgp25/instagram-php
this created a '/vendor' folder in my project (projects folder is "TinderAI").
I've created an 'TinderAI/index.php; file containing:
<?php
require __DIR__.'/../vendor/autoload.php';
$ig = new \InstagramAPI\Instagram();
(this 'require' address is in the README file of the library). Whenever i ran
php index.php
I got error in my /Applications/MAMP/logs/php_error.log file:
[03-Oct-2018 11:50:24 Europe/Berlin] PHP Warning: require(/Users/sergeyfomin/code/tinderAI/../vendor/autoload.php): failed to open stream: No such file or directory in /Users/sergeyfomin/code/tinderAI/index.php on line 3
[03-Oct-2018 11:50:24 Europe/Berlin] PHP Fatal error: require(): Failed opening required '/Users/sergeyfomin/code/tinderAI/../vendor/autoload.php' (include_path='.:/Applications/MAMP/bin/php/php7.1.12/lib/php') in /Users/sergeyfomin/code/tinderAI/index.php on line 3
there is /examples folder in the library to test it. If I ran any example file, for example "php accessingValues.php" I get similar error (now with the name of the executed file):
[02-Oct-2018 16:08:13 UTC] PHP Warning: require(/Users/sergeyfomin/code/tinderAI/vendor/mgp25/instagram-php/examples/../vendor/autoload.php): failed to open stream: No such file or directory in /Users/sergeyfomin/code/tinderAI/vendor/mgp25/instagram-php/examples/accessingValues.php on line 6
[02-Oct-2018 16:08:13 UTC] PHP Fatal error: require(): Failed opening required '/Users/sergeyfomin/code/tinderAI/vendor/mgp25/instagram-php/examples/../vendor/autoload.php' (include_path='.:/Applications/MAMP/bin/php/php7.1.12/lib/php') in /Users/sergeyfomin/code/tinderAI/vendor/mgp25/instagram-php/examples/accessingValues.php on line 6
I think this is a very basic level mistake with paths to the files in php, but I can't figure it out. Would be glad if you can help me.