首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法将SabreDAV配置为测试Webdav和CardDAV

无法将SabreDAV配置为测试Webdav和CardDAV
EN

Stack Overflow用户
提问于 2014-04-09 15:35:20
回答 1查看 1K关注 0票数 2

我遵循的步骤是:

  1. 下载了Sabredav压缩文件-解压缩它。
  2. 下载apache PHP服务器2.2和PHP5.3
  3. 然后按照Sabredav网站上“开始”部分中提到的说明进行操作。
  4. 创建‘数据和公共’fiels (位于/sabredav/供应商/)
  5. 创建了server.php文件(位于/sabredav/供应商/中)
  6. 现在尝试在浏览器中打开server.php文件-

在这里,它使用文件协议打开。无法在预期中打开- 'http ://mydomain/sabredav/server.php -‘有人能在这方面帮助我吗?

谢谢

EN

回答 1

Stack Overflow用户

发布于 2014-05-16 14:10:45

在server.php中,使用浏览器插件tu查看公用文件夹中的文件。您的服务器必须像这样:

代码语言:javascript
复制
include 'SabreDAV/vendor/autoload.php';
use
    Sabre\DAV;
$rootDirectory = new DAV\FS\Directory('public');

// The server object is responsible for making sense out of the WebDAV protocol
$server = new DAV\Server($rootDirectory);

// If your server is not on your webroot, make sure the following line has the correct information

$server->setBaseUri('/server.php'); // if its in some kind of home directory

// The lock manager is reponsible for making sure users don't overwrite each others changes. Change 'data' to a different 
// directory, if you're storing your data somewhere else.
$lockBackend = new DAV\Locks\Backend\File('data/locks');
$lockPlugin = new DAV\Locks\Plugin($lockBackend);
$server->addPlugin($lockPlugin);
$server->addPlugin(new \Sabre\DAV\Browser\GuessContentType());
$plugin = new \Sabre\DAV\Browser\Plugin();
$server->addPlugin($plugin);
// All we need to do now, is to fire up the server
$server->exec();
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/22967406

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档