phpZoteroWebDAV 2.0 – Download and Installation

By , 2 November 2011 13:54

Features (! means new in 2.0)

  • sync library attachment to any php enabled webhosting space (including freely available ones) through a php based WebDAV implementation. This means that you attachment data never has to be stored on computers (clients and servers) that you do not control yourself.
  • ! access your zotero library through zotero.org server API, including sorting, detail view, custom number of items per page etc
  • ! view your synced attachments from any web browser without having to use zotero.org’s own storage server
  • ! unlike zotero.org’s own attachment viewing feature, phpZoteroWebDAV allows you to view web snapshots as well

Download

  • Download phpZoteroWebDAV 2.0 (md5=50ff48cb0f6bf1326bcaea551c76edcc) directly from this site. Note that while I strive to keep this download link up to date, some minor updates might not be included yet. Therefore, if you want to ensure to use the most up-to-date code, use the github link below.
  • phpZoteroWebDAV is on github, so if you want to make modifications to the code, you can fork it there. This repo also contains always the most recent version of the code.

Installation

Simply unzip the zip file you just downloaded and upload it to your webspace (you might want to complete the steps in the server part of the configuration instructions below first), e.g. to www.example.com/zotero. You must make sure that both the “data” and “cache” are writable by the user that runs your php process (ask your hosting service and/or google if you don’t know how – chances are good that you don’t need to do anything) and I would strongly suggest to password protect the directory that you just uploaded your script to (for example using .htaccess – again, google how or ask your hosting company) – otherwise your data will be accessible for everybody who knows/guesses the URL.

In the above example, www.example.com/zotero will be the address you use to access your library view and the attachments.

Configuration

There are two parts to configure: the server site (i.e. the settings for the script itself, contained in the file settings.php) and your zotero client. I will walk you through both parts:

1. Server Configuration

The zip file you just downloaded and unzipped contains a file “settings.php”. Open this file with your favourite text editor. The parameters that MUST be set are the first two: $API_key and $user_ID. Navigate to https://www.zotero.org/settings/keys to get these values (you might have to sign in to your zotero.org account). On that page you see “Your userID for use in API calls is….” – the number that follows here goes in $user_ID. The you need to “Create new private key” for the script to use. Give it only as much power over your library it needs: the script only needs read access to your personal library, so you can disable everything else (have a look at this screenshot for the correct settings). Once created, copy and past the key into $API_key. Now you can have a look at the other settings (but you can also just keep defaults) and once save the settings.php file and upload it to your webserver.  That’s all for server settings.

2. Client Settings

In your zotero client (i.e. in firefox or standalone zotero), open the sync tab in the preferences.  In the “File Syncing” section, select “WebDAV” from the list. In the URL field make sure you select “http” instead of “https” unless you are very very sure that the ssl on your webserver is set up correctly. In the address field enter the URL that points to the directory to which you just uploaded the script (e.g. www.example.com/zotero) and then add “/webdav_server.php”, so that the whole path (including the “/zotero” suffix that cannot be changed) would be www.example.com/zotero/webdav_server.php/zotero

For username and password use the values that you created when setting up password protection as I advised you above. It is important to note that even if you ignored my well meaning advice and did NOT set up password protection for that directory, you still need to enter something in these fields.

Once this is all set up, you should be able to “Verify Server” and make your first sync, after that you can try and access your library and the attachment though this script.

 

Good luck and share any successes or failures (including detailed description of what is going wrong) either here or on the relevant thread at zotero.org (chances might be higher you get a reply there).

If you want to read about background and motivation for this project, there is another blog post related to that.

6 Responses to “phpZoteroWebDAV 2.0 – Download and Installation”

  1. Frederic says:

    Hi,

    First, I would like to thank you for sharing this script, very useful.
    I’ve installed it, and sync works nice.
    The only problem I’ve encountered is with index.php. It does not locally display the library , whereas it is visible on zotero.org account.
    Any advices?

    frederic

    • krueschan says:

      Hi Frederic,
      I had a look at your settings.php and all seems in order. However, using your API key I get a “Forbidden” error message back from zotero.org so it seems like you are using the wrong permissions. Have a look at this screenshot and make sure your settings match.
      Christian

    • krueschan says:

      After some email exchange with Frederic, it turned out that he actually had forgotten to give the script read permissions to his zotero library in the settings on zotero.org. As a result I added the screenshots of the settings page to these installation instructions.

  2. avaidya says:

    Hi Frederic,

    I’m having some trouble getting the sync to work… I’ve edited the settings to include my key and ID and dropped the folder into my server, but Zotero continues to give me a permissions error:

    You don’t have permission to access /zotero/webdav_server.php/zotero/
    on the WebDAV server. Please check your file sync settings or contact
    your server administrator.

    When I turn on all permissions for the folder and all subfolders, I receive the following error:

    Your WebDAV server returned an internal error.

    Please check your file sync settings or contact your server administrator.

    Do you have any ideas on how to fix this?

    Thanks a lot.

  3. Dan says:

    Hi Christian,

    Is phpZoteroWebDAV 2.0 compatible with PHP 5.4.0 and/or PHP 4.x? Just want to get set up correctly before intalling your fine work.

    Thanks

  4. krueschan says:

    Yo Dan,

    Go with PHP 5 – there have been instances of people reporting issues with PHP 4.x
    I don’t recall what the issues were (they were fixable) but I am using some functions that were not part of PHP 4.x

    I am running PHP 5.3.8 on my development machine and 5.2.17 on my production server, so these two definitely work. I am not following the evolution of PHP closely enough to say with absolute certainty that using a newer version of PHP than either of these would work, but I seriously doubt there is an issue with using PHP 5.4.x

    Hope this helps and thanks for the interest
    Christian

Leave a Reply

Panorama Theme by Themocracy