2

Steps I followed:

  1. Downloaded the Sabredav zip file - unzipped it.
  2. Downloaded apache webserver 2.2 and PHP 5.3
  3. Then followed the instructions mentioned in the 'get Started' section on Sabredav website.
  4. Created 'data and public' fiels (located them in /sabredav/vendor/)
  5. Created the server.php file (located it in /sabredav/vendor/)
  6. Now tried to open the server.php file in browser -

Here it opens using the file protocol.. Fails to open in expected - 'http ://mydomain/sabredav/server.php Can anybody please help me on this ?

Thanks

Vipul
  • 31
  • 2
  • I had the same problem. The example code seems to imply that server.php should actually be in the /lib folder, but that did not make a difference for me. – MastaBaba Apr 13 '14 at 19:22

1 Answers1

0

In server.php, use the browser plugin tu see files in Public folder. Your server must be like this:

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();
Kassav'
  • 1,130
  • 9
  • 29