dsklfsdlkf1232 2018-10-03 09:37
浏览 223

PHP致命错误:require():需要打开失败

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.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 关于#网络安全#的问题:求ensp的网络安全,不要步骤要完成版文件
    • ¥15 可否在不同线程中调用封装数据库操作的类
    • ¥20 使用Photon PUN2解决游戏得分同步的问题
    • ¥15 微带串馈天线阵列每个阵元宽度计算
    • ¥15 keil的map文件中Image component sizes各项意思
    • ¥30 BC260Y用MQTT向阿里云发布主题消息一直错误
    • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
    • ¥15 划分vlan后,链路不通了?
    • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
    • ¥15 Vue3 大型图片数据拖动排序