2

我遵循的步骤:

  1. 下载 Sabredav zip 文件 - 将其解压缩。
  2. 下载 apache webserver 2.2 和 PHP 5.3
  3. 然后按照 Sabredav 网站上“开始使用”部分中提到的说明进行操作。
  4. 创建“数据和公共”字段(位于 /sabredav/vendor/)
  5. 创建 server.php 文件(位于 /sabredav/vendor/ 中)
  6. 现在尝试在浏览器中打开 server.php 文件 -

在这里它使用文件协议打开.. 无法按预期打开 - 'http://mydomain/sabredav/server.php 有人可以帮我吗?

谢谢

4

1 回答 1

0

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

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();
于 2014-05-16T14:10:45.363 回答