You can set a custom temp folder setting the first option:
[settings] ; absolute path to the temp dir. If empty the default system tmp directory will be used temp_path = ""
You can set any existing folder with rw access for the user you are using.
We also recommend you testing the included samples using PHP CLI mode and check your server logs to be able to find the source of your problem with the target folder you are using to save the documents.