Hello,
Please try setting full access (777) to the whole folder (and its contents):
/var/root/Library/Saved%20Application%20State/org.libreoffice.script.savedState
and check is the permission denied go away.
About the folder, we can't guess, so the best approach is to check the web server config and the PHP info.
Regards.