简体   繁体   English

无法打开流:没有这样的文件或目录

[英]failed to open stream: No such file or directory

i tried to activate the zibbra library.我试图激活 zibbra 库。 the library and the adapter which i follow into the zibbra documentation my folder path is like this c:\\xampp\\htdocs\\doorbraakboeken and its seems that when i activate the library this is what it goes我在 zibbra 文档中遵循的库和适配器我的文件夹路径是这样的 c:\\xampp\\htdocs\\doorbraakboeken 似乎当我激活库时它就是这样

Warning: require_once(../api-client-library/php/library.php): failed to open stream: No such file or directory in /var/www/html/wp-content/themes/doorbraak/templates/homepage.php on line 8

Fatal error: require_once(): Failed opening required '../api-client-library/php/library.php' (include_path='/var/www/html/vendor') in /var/www/html/wp-content/themes/doorbraak/templates/homepage.php on line 8

My code is written inside doorbraakboeken.be/wp-content/themes/doorbraak/templates/homepage.php file this is my code below to call the library我的代码写在 doorbraakboeken.be/wp-content/themes/doorbraak/templates/homepage.php 文件中,这是我在下面调用库的代码

<?php


    require_once("../api-client-library/php/library.php");
    require_once("../api-client-library/php/adapter/standalone");

    //Instantiate the adapter
    $adapter = new Zibbra_Adapter_Standalone();

    //Instantiate the library
    $library =  ZLibrary::getInstance($adapter);
    $library->setApiClientId("test client id");
    $library->setApiClientSecret("test client secret");

?>

This is my folder main folder doorbraakboeken inside folder is这是我的文件夹主文件夹doorbraakboeken里面的文件夹是

api-client-library
doorbraakboeken.be
wordpress.zibbra.com

Im using windows and im using vagrant virtual box Can someone help me figured this out to point correctly the path in order to load my library?我正在使用 Windows 并且我正在使用 vagrant 虚拟框 有人可以帮我弄清楚这一点以正确指向路径以加载我的库吗? Any help is muchly appreciated.非常感谢任何帮助。 TIA TIA

Try as below: 尝试如下:

require_once __DIR__ . "/relative/path/from_file";

//For You
require_once __DIR__ . "/doorbraakboeken/api-client-library/...upto_file_dest";

OR 要么

Try by making below change: 尝试进行以下更改:

change your DocumentRoot From "C:/xampp/htdocs" to Your project directory or wherever you want by configuring file C:\\xampp\\apache\\conf\\httpd.conf. 通过配置文件C:\\ xampp \\ apache \\ conf \\ httpd.conf,将DocumentRoot从“ C:/ xampp / htdocs”更改为项目目录或您想要的任何位置。

使用以下功能更改文档根目录。

<?php include( get_template_directory() . '/includes/myfile.php'); ?>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM